package com.zph.dao;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.junit.Test;
import org.wltea.analyzer.core.IKSegmenter;
import org.wltea.analyzer.core.Lexeme;

import com.zph.entity.Basic;
import com.zph.entity.BasicCV;
import com.zph.entity.BasicDE;
import com.zph.entity.BasicES;
import com.zph.entity.BasicFunction;
import com.zph.entity.BasicJS;
import com.zph.entity.BasicJT;
import com.zph.entity.BasicNow;
import com.zph.entity.CV;
import com.zph.entity.CVObject;
import com.zph.entity.Comment;
import com.zph.entity.Constants;
import com.zph.entity.Education;
import com.zph.entity.EducationNow;
import com.zph.entity.Expectation;
import com.zph.entity.Expectation;
import com.zph.entity.Job;
import com.zph.entity.Medal;
import com.zph.entity.Paper;
import com.zph.entity.Patent;
import com.zph.entity.Project;
import com.zph.entity.Skill;

public class ParseResume {
	public static HashMap<String, Integer> m_UserDic = new HashMap<String, Integer>(15000, 0.75f);
	private String degree = null;
	private String gender = "";
	private String age = "";
	private String phone = "";
	private String email = "";
	private String jobtime = "";
	private String genderBehind = "";
	private String ageBehind = "";
	private String phoneBehind = "";
	private String emailBehind = "";
	private String jobtimeBehind = "";
	private String degreeBehind = "";

	// 初始化词典
	static {
		init(Constants.User);

		// init("D:/zzh_file/User.txt");
	}

	/**
	 * 初始化用户自定义词典
	 */
	public static int init(String fileName) {

		InputStream in = null ;
		String[] str = null;
		try {
			in = Constants.class.getResourceAsStream(fileName);
		
			String tempStr = "";
			BufferedReader read = new BufferedReader(new InputStreamReader(in,"utf-8"));
			int count = 0;
			while ((tempStr = read.readLine()) != null) {
				str = tempStr.split(",|/");
				m_UserDic.put(str[0], Integer.parseInt(str[1]));
			}
			str = null;
			tempStr = null;
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (in != null) {
					in.close();
					in = null;
				}
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
		return 0;
	}

	/**
	 * 排序函数 插入排序(根据在文本中的位置升序排列)
	 * 
	 */
	private void insertsort(int[][] indexs) {

		for (int i = 1, len = indexs[0].length; i < len; i++) {
			int key = indexs[0][i];
			int value = indexs[1][i];
			int j = i;
			while (--j >= 0 && key < indexs[0][j]) {
				indexs[0][j + 1] = indexs[0][j];
				indexs[1][j + 1] = indexs[1][j];
			}
			indexs[0][j + 1] = key;
			indexs[1][j + 1] = value;
		}
	}

	/**
	 * 函数名：parseBasic() 功 能：识别基本信息块的姓名、性别、年龄、现居地、学校、学历 * 手机、邮箱、公司、职位、专业等。
	 * 
	 * @param info
	 *            已经分好的块信息
	 * @param map
	 * @return
	 * @throws IOException
	 */
	// 姓名、 地址、学校、学历、公司、职位、身高、体重、bwh、婚姻状况、名族、专业、政治面貌、国家、健康状况
	private int checkBasic(String info, CVObject map) throws IOException {
		StringBuilder sName = new StringBuilder();
		StringBuilder sLocation = new StringBuilder();
		StringBuilder sSchool = new StringBuilder();
		StringBuilder sDegree = new StringBuilder();
		StringBuilder sCompany = new StringBuilder();
		StringBuilder sTitle = new StringBuilder();
		StringBuilder sHeight = new StringBuilder();
		StringBuilder sWeight = new StringBuilder();
		StringBuilder sBWH = new StringBuilder();
		StringBuilder sMarriage = new StringBuilder();
		StringBuilder sNation = new StringBuilder();
		StringBuilder sMajor = new StringBuilder();
		StringBuilder sPolitics = new StringBuilder();
		StringBuilder sCountry = new StringBuilder();
		StringBuilder sHealth = new StringBuilder();
		String basicSchool = "";
		int iBasicSchool, iCountry, iHealth, iPolitics, iName, iLocation, iSchool, iDegree, iCompany, iTitle, iHeight,
				iWeight, iBWH, iMarriage, iNation, iMajor;
		iBasicSchool = iCountry = iHealth = iPolitics = iName = iLocation = iSchool = iDegree = iCompany = iTitle = iHeight = iWeight = iBWH = iMarriage = iNation = iMajor = 0;
		boolean bCountry, bHealth, bPolitics, bName, bLocation, bSchool, bDegree, bCompany, bTitle, bHeight, bWeight,
				bBWH, bMarriage, bNation, bMajor;
		bCountry = bHealth = bPolitics = bName = bLocation = bSchool = bDegree = bCompany = bTitle = bHeight = bWeight = bBWH = bMarriage = bNation = bMajor = false;
		int type = 0;
		boolean bBasicSchool = true;
		StringReader sr = new StringReader(info);
		IKSegmenter ik = new IKSegmenter(sr, true);
		Lexeme lex = null;
		String temp = "";
		int c = 0;
		while ((lex = ik.next()) != null) {
			iBasicSchool--;
			iHealth--;
			iCountry--;
			iPolitics--;
			iName--;
			iLocation--;
			iSchool--;
			iDegree--;
			iCompany--;
			iTitle--;
			iHeight--;
			iWeight--;
			iBWH--;
			iMarriage--;
			iNation--;
			iMajor--;
			temp = lex.getLexemeText();
			if (temp != null && m_UserDic.containsKey(temp)) {
				type = m_UserDic.get(temp);
				switch (type) {
				case 3: // 学校
					iBasicSchool = 1;
					break;
				case 200: // 姓名
					bName = true;
					iName = 2;
					bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 201: // 性别
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 202: // 年龄
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 203: // 现居地
					bLocation = true;
					bName = bSchool = bCompany = bMajor = false;
					iLocation = 2;
					break;
				case 204: // 毕业学校
					bSchool = true;
					iSchool = 2;
					bName = bLocation = bCompany = bMajor = false;
					break;
				case 205: // 最高学历
					bDegree = true;
					iDegree = 2;
					bCompany = bName = bLocation = bSchool = bMajor = false;
					break;
				case 206: // 联系电话
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 207: // 邮件
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 208: // 公司
					bCompany = true;
					iCompany = 2;
					bName = bSchool = bLocation = bMajor = false;
					break;
				case 209: // 职位
					bTitle = true;
					iTitle = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 210: // 工作年限
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 211: // 身高
					bHeight = true;
					iHeight = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 212: // 体重
					bWeight = true;
					iWeight = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 213: // 三围
					bBWH = true;
					iBWH = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 214: // 婚否
					bMarriage = true;
					iMarriage = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 215: // 名族
					bNation = true;
					iNation = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 216: // 专业
					bMajor = true;
					iMajor = 2;
					bCompany = bName = bSchool = bLocation = false;
					break;
				case 217: // 身体状况
					bHealth = true;
					iHealth = 2;
					bMajor = bCompany = bName = bSchool = bLocation = false;
					break;
				case 218: // 国籍
					bCountry = true;
					iCountry = 2;
					bMajor = bCompany = bName = bSchool = bLocation = false;
					break;
				case 219: // 政治面貌
					bPolitics = true;
					iPolitics = 2;
					bMajor = bCompany = bName = bSchool = bLocation = false;
					break;
				default: // 其他
					break;
				}
			} else {
			}
			if (bBasicSchool && iBasicSchool == 1) {
				basicSchool = temp;
			}
			if (bCountry && iCountry == 1) {
				sCountry.append(temp);
			}
			if (bHealth && iHealth == 1) {
				sHealth.append(temp);
			}
			if (bPolitics && iPolitics == 1) {
				sPolitics.append(temp);
			}
			if (bName && iName == 1) {
				if (sName != null && sName.length() <= 10) {
					sName.append(temp);
					iName = 2;
				}
			}
			if (bLocation && iLocation == 1) {
				if (sLocation != null && sLocation.length() <= 15) {
					sLocation.append(temp);
					iLocation = 2;
				}
			}
			if (bSchool && iSchool == 1) {
				if (sSchool != null && sSchool.length() <= 15) {
					sSchool.append(temp);
					iSchool = 2;
				}
			}
			if (bDegree && iDegree == 1) {
				sDegree.append(temp);
			}
			if (bCompany && iCompany == 1) {
				if (sCompany != null && sCompany.length() <= 20) {
					sCompany.append(temp);
					iCompany = 2;
				}
			}
			if (bTitle && iTitle == 1)
				sTitle.append(temp);
			if (bHeight && iHeight == 1)
				sHeight.append(temp);
			if (bWeight && iWeight == 1)
				sWeight.append(temp);
			if (bBWH && iBWH == 1)
				sBWH.append(temp);
			if (bMarriage && iMarriage == 1)
				sMarriage.append(temp);
			if (bNation && iNation == 1)
				sNation.append(temp);
			if (bMajor && iMajor == 1) {
				if (sMajor != null && sMajor.length() <= 10) {
					sMajor.append(temp);
					iMajor = 2;
				}
			}
		}

		BasicNow basic = new BasicNow();
		BasicES es = new BasicES();
		es.setId(67);
		basic.setExpectedSalary(es);
		BasicFunction function = new BasicFunction();
		function.setId(0);
		basic.setFunctionId(function);
		BasicJS js = new BasicJS();
		js.setId(65);
		basic.setJobStatus(js);
		BasicJT jt = new BasicJT();
		Pattern pjobTime = Pattern.compile("\\d{1}");
		Matcher mjobTime = pjobTime.matcher(jobtime);
		String tempJobTime = "";
		while (mjobTime.find()) {
			tempJobTime = mjobTime.group();
			break;
		}

		Pattern pjobTime2 = Pattern.compile("\\d{2}");
		Matcher mjobTime2 = pjobTime2.matcher(jobtime);
		while (mjobTime2.find()) {
			tempJobTime = mjobTime2.group();
			break;
		}
		int intJobTime = 0;
		if (tempJobTime != null && !tempJobTime.equals("")) {
			intJobTime = Integer.parseInt(tempJobTime);
		}
		if (intJobTime >= 1 && intJobTime <= 3) {
			jt.setId(12);
		} else if (intJobTime > 3 && intJobTime <= 5) {
			jt.setId(102);
		} else if (intJobTime > 5 && intJobTime <= 10) {
			jt.setId(103);
		} else if (intJobTime > 10) {
			jt.setId(104);
		} else {
			jt.setId(11);
		}

		BasicCV cv = new BasicCV();
		cv.setId(0);
		basic.setCv(cv);
		BasicDE basicDE = new BasicDE();
		if (degree != null && (degree.contains("专科") || degree.contains("大专"))) {
			basicDE.setId(3);
		} else if (degree != null && degree.contains("本科") || degree != null && degree.contains("学士")) {
			basicDE.setId(4);
		} else if (degree != null && degree.contains("硕士") || degree != null && degree.contains("研究生")) {
			basicDE.setId(5);
		} else if (degree != null && degree.contains("博士")) {
			basicDE.setId(6);
		} else if (degree != null && degree.contains("博士后")) {
			basicDE.setId(7);
		} else {
			basicDE.setId(0);
		}
		basic.setDegree(basicDE);
		basic.setCountry(sCountry.toString());
		basic.setHealth(sHealth.toString());
		basic.setPolitics(sPolitics.toString());
		basic.setBasicInfo(info);
		basic.setName(sName.toString());
		basic.setGender(gender.equals("女") ? 2 : 0);
		if (basic.getGender() == 0) {
			basic.setGender(gender.equals("男") ? 1 : 0);
		}
		basic.setAge(getAgeNum(age));
		basic.setAddress(sLocation.toString());
		basic.setSchool(basicSchool);
		if (basic.getSchool().length() > 22) {
			basic.setSchool(basic.getSchool().substring(0, 21));
		}
		phone = phone.replaceAll("-", "");
		basic.setMobile(phone);
		basic.setEmail(email);
		// basic.setJobTime(jt);
		Long longJobTime = new Long((long) intJobTime);
		basic.setJob_time(longJobTime);
		basic.setCompany(sCompany.toString());
		if (basic.getCompany().length() > 50) {
			basic.setCompany(basic.getCompany().substring(0, 49));
		}
		basic.setTitle(sTitle.toString());
		if (basic.getTitle().length() > 12) {
			basic.setTitle(basic.getTitle().substring(0, 11));
		}
		basic.setHeight(sHeight.toString());
		basic.setWeight(sWeight.toString());
		basic.setBwh(sBWH.toString());
		basic.setMarriage(sMarriage.toString().equals("") ? 0 : 1);
		basic.setMajor(sMajor.toString().trim());
		basic.setBasicInfo(info);

		// map.setBasic(basic);
		int flag = 1;

		if ((basic.getWeight() == null || basic.getWeight().equals(""))
				&& (basic.getHeight() == null || basic.getHeight().equals(""))
				&& (basic.getName() == null || basic.getName().equals(""))
				&& (basic.getBirthday() == null || basic.getBirthday().equals(""))
				&& (basic.getAge() == null || basic.getAge().equals(""))
				&& (basic.getBirthPlace() == null || basic.getBirthPlace().equals(""))
				&& (basic.getSchool() == null || basic.getSchool().equals("")) && (basic.getDegree() == null)) {
			flag = 0;
			// break;
		} else {
			flag = 1;
			// break;
		}
		// System.out.println("basic flag = " + flag);
		sName = sLocation = sSchool = sDegree = sCompany = sTitle = sHeight = sWeight = sBWH = sMarriage = sNation = sMajor = null;
		basic = null;
		return flag;

	}

	private String getAgeNum(String str) {
		String age = null;
		Pattern p = Pattern.compile("[0-9]+");
		Matcher m = p.matcher(str);
		if (m.find()) {
			age = m.group();
		}
		return age;
	}

	/**
	 * 函数名：parseEducation() 功 能：识别教育背景信息块的起止时间、学校、专业、学历
	 * 
	 */
	private int checkEducation(String info, CVObject map) throws IOException {
		StringBuffer sEducation = new StringBuffer();
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<EducationNow> eList = new ArrayList<EducationNow>();
		Pattern pattern = Pattern.compile( //
				"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
						+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
						+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
						+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
						+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
						+ "((19\\d{2}|20\\d{2})\\s*年)|" //
						+ "((19\\d{2}|20\\d{2}))"); //
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			matcher.appendReplacement(sEducation, info);
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i + 1) - iList.get(i) >= 15) {
				iList.set(i, info.length() * 2);
				i++;
			} else {
				i = i + 2;
			}
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i) == info.length() * 2) {
				iList.remove(i);
				sList.remove(i);
			} else {
				i++;
			}
		}

		if (iList.size() % 2 == 1) {
			iList.remove(iList.size() - 1);
			sList.remove(sList.size() - 1);
		}

		// 处理只有年份的情况
		if (iList.size() < 2) {
			Pattern pattern1 = Pattern.compile("((19\\d{2}|20\\d{2}))|" //
					+ "((19\\d{2}|20\\d{2}))|" //
					+ "((19\\d{2}|20\\d{2})年)|" //
					+ "((19\\d{2}|20\\d{2}))|" //
					+ "现在|至今|到现在|目前 ");
			Matcher matcher1 = pattern1.matcher(info);
			while (matcher1.find()) {
				String str = matcher1.group();
				sList.add(str);
				iList.add(matcher1.start());
			}

			for (Integer iListOne : iList) {
				// System.out.println(iListOne);
			}
			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i + 1) - iList.get(i) >= 15) {
					iList.set(i, info.length() * 2);
					i++;
				} else {
					i = i + 2;
				}
			}

			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i) == info.length() * 2) {
					iList.remove(i);
					sList.remove(i);
				} else {
					i++;
				}
			}

			if (iList.size() % 2 == 1) {
				iList.remove(iList.size() - 1);
				sList.remove(sList.size() - 1);
			}
		}

		int length = info.length();
		String edu = "";
		Lexeme lex = null;
		String temp = "";
		int type = 0;
		int iSchool, iMajor, iDegree;
		iSchool = iMajor = iDegree = 0;
		for (int i = 0, len = iList.size(); i < len;) {
			if (iList.size() > 2) {
				if (i == 0) {
					String school = "";
					String major = "";
					String degree = "";
					edu = info.substring(iList.get(i), iList.get(i + 2));
					StringReader sr = new StringReader(edu);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iSchool--;
						iDegree--;
						iMajor--;
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							case 3:
								iSchool = 2;
								break;
							case 5:
								degree = temp; // 学历验证
								break;
							case 13:
								iMajor = 2;
								break;
							case 250:
								// iDegree = 2;
								degree = temp;
								break;
							case 251:
								// iDegree = 2;
								degree = temp;
								break;
							case 252:
								// iDegree = 2;
								degree = temp;
								break;
							case 253:
								// iDegree = 2;
								degree = temp;
								break;
							default:
								break;
							}
						}
						if (iSchool == 2)
							school = lex.getLexemeText();
						if (iMajor == 2)
							major = lex.getLexemeText();
						/*
						 * if (iDegree == 1) degree = lex.getLexemeText();
						 */
					}
					EducationNow education = new EducationNow();
					String text = sList.get(i);
					education.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					education.setEndTime(getStartTime(textSen));
					education.setSchool(school);
					if (education.getSchool().length() > 22) {
						education.setSchool(education.getSchool().substring(0, 21));
					}
					education.setMajor(major);
					BasicDE basicDE = new BasicDE();
					if (degree.contains("专科") || degree.contains("大专")) {
						basicDE.setId(3);
					} else if (degree.contains("本科") || degree.contains("学士")) {
						basicDE.setId(4);
					} else if (degree.contains("硕士") || degree.contains("研究生")) {
						basicDE.setId(5);
					} else if (degree.contains("博士")) {
						basicDE.setId(6);
					} else if (degree.contains("博士后")) {
						basicDE.setId(7);
					}
					education.setDegree(basicDE);
					int staIndex = edu.indexOf(sList.get(i));
					int endIndex = staIndex;
					String subInfo = "";
					String infoFirst = "";
					if ((i + 1) < sList.size()) {
						endIndex = edu.indexOf(sList.get(i + 1));
						subInfo = edu.substring(staIndex, endIndex + sList.get(i + 1).length());
						infoFirst = edu.substring(endIndex + sList.get(i + 1).length());
					} else {
						subInfo = edu.substring(staIndex, staIndex + sList.get(i).length());
						infoFirst = edu.substring(staIndex + sList.get(i).length());
					} 
					education.setInfo(infoFirst);
					education.setEducationInfo(info.trim());
					// System.out.println("education" + education.toString() );
					eList.add(education);
					education = null;
				} else if (i < len - 3) {
					String school = "";
					String major = "";
					String degree = "";
					edu = info.substring(iList.get(i), iList.get(i + 2));
					StringReader sr = new StringReader(edu);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iSchool--;
						iDegree--;
						iMajor--;
						temp = lex.getLexemeText();
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							case 3:
								iSchool = 2;
								break;
							case 5:
								degree = temp; // 学历验证
								break;
							case 13:
								iMajor = 2;
								break;
							case 250:
								// iDegree = 2;
								degree = temp;
								break;
							case 251:
								// iDegree = 2;
								degree = temp;
								break;
							case 252:
								// iDegree = 2;
								degree = temp;
								break;
							case 253:
								// iDegree = 2;
								degree = temp;
								break;
							default:
								break;
							}
						}
						if (iSchool == 2)
							school = lex.getLexemeText();
						if (iMajor == 2)
							major = lex.getLexemeText();
						/*
						 * if (iDegree == 1) degree = lex.getLexemeText();
						 */

					}
					EducationNow education = new EducationNow();
					String text = sList.get(i);
					education.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					education.setEndTime(getStartTime(textSen));
					education.setSchool(school);
					if (education.getSchool().length() > 22) {
						education.setSchool(education.getSchool().substring(0, 21));
					}
					education.setMajor(major);
					BasicDE basicDE = new BasicDE();
					if (degree.contains("专科") || degree.contains("大专")) {
						basicDE.setId(3);
					} else if (degree.contains("本科") || degree.contains("学士")) {
						basicDE.setId(4);
					} else if (degree.contains("硕士") || degree.contains("研究生")) {
						basicDE.setId(5);
					} else if (degree.contains("博士")) {
						basicDE.setId(6);
					} else if (degree.contains("博士后")) {
						basicDE.setId(7);
					}
					education.setDegree(basicDE);
					/*
					 * String infoFirst = edu.replaceAll(sList.get(i), "");
					 * String infoSecond = infoFirst.replaceAll(sList.get(i+1),
					 * "");
					 */
					int staIndex = edu.indexOf(sList.get(i));
					int endIndex = staIndex;
					String subInfo = "";
					String infoFirst="";
					if ((i + 1) < sList.size()) {
						endIndex = edu.indexOf(sList.get(i + 1));
						subInfo = edu.substring(staIndex, endIndex + sList.get(i + 1).length());
						infoFirst = edu.substring( endIndex + sList.get(i + 1).length());
					} else {
						subInfo = edu.substring(staIndex, staIndex + sList.get(i).length());
						infoFirst = edu.substring(staIndex + sList.get(i).length());
					} 
					education.setInfo(infoFirst);
					education.setEducationInfo(info.trim());
					// System.out.println("education" + education.toString() );
					eList.add(education);
					education = null;
				} else {
					String school = "";
					String major = "";
					String degree = "";
					edu = info.substring(iList.get(i), length);
					StringReader sr = new StringReader(edu);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iSchool--;
						iDegree--;
						iMajor--;
						temp = lex.getLexemeText();
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							case 3:
								iSchool = 2;
								break;
							case 5:
								degree = temp; // 学历验证
								break;
							case 13:
								iMajor = 2;
								break;
							case 250:
								// iDegree = 2;
								degree = temp;
								break;
							case 251:
								// iDegree = 2;
								degree = temp;
								break;
							case 252:
								// iDegree = 2;
								degree = temp;
								break;
							case 253:
								// iDegree = 2;
								degree = temp;
								break;
							default:
								break;
							}
						}
						if (iSchool == 2)
							school = lex.getLexemeText();
						if (iMajor == 2)
							major = lex.getLexemeText();
						/*
						 * if (iDegree == 1) degree = lex.getLexemeText();
						 */

					}
					EducationNow education = new EducationNow();
					String text = sList.get(i);
					education.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					education.setEndTime(getStartTime(textSen));
					education.setSchool(school);
					if (education.getSchool().length() > 22) {
						education.setSchool(education.getSchool().substring(0, 21));
					}
					education.setMajor(major);
					BasicDE basicDE = new BasicDE();
					if (degree.contains("专科") || degree.contains("大专")) {
						basicDE.setId(3);
					} else if (degree.contains("本科") || degree.contains("学士")) {
						basicDE.setId(4);
					} else if (degree.contains("硕士") || degree.contains("研究生")) {
						basicDE.setId(5);
					} else if (degree.contains("博士")) {
						basicDE.setId(6);
					} else if (degree.contains("博士后")) {
						basicDE.setId(7);
					}
					education.setDegree(basicDE);
					int staIndex = edu.indexOf(sList.get(i));
					int endIndex = staIndex;
					String subInfo = "";
					String infoFirst="";
					if ((i + 1) < sList.size()) {
						endIndex = edu.indexOf(sList.get(i + 1));
						subInfo = edu.substring(staIndex, endIndex + sList.get(i + 1).length());
						infoFirst = edu.substring(endIndex + sList.get(i + 1).length()); 
					} else {
						subInfo = edu.substring(staIndex, staIndex + sList.get(i).length());
						infoFirst = edu.substring( staIndex + sList.get(i).length()); 
					}
//					String infoFirst = edu.replace(subInfo, "");
					  
					education.setInfo(infoFirst);
					education.setEducationInfo(info.trim());
					// System.out.println("education" + education.toString() );
					eList.add(education);
					education = null;
				}
			} else {
				String school = "";
				String major = "";
				String degree = "";
				edu = info.substring(0, length);
				StringReader sr = new StringReader(edu);
				IKSegmenter ik = new IKSegmenter(sr, true);
				while ((lex = ik.next()) != null) {
					iSchool--;
					iDegree--;
					iMajor--;
					temp = lex.getLexemeText();
					if (m_UserDic.containsKey(temp)) {
						type = m_UserDic.get(temp);
						switch (type) {
						case 3:
							iSchool = 2;
							break;
						case 5:
							degree = temp; // 学历验证
							break;
						case 13:
							iMajor = 2;
							break;
						case 250:
							// iDegree = 2;
							degree = temp;
							break;
						case 251:
							// iDegree = 2;
							degree = temp;
							break;
						case 252:
							// iDegree = 2;
							degree = temp;
							break;
						case 253:
							// iDegree = 2;
							degree = temp;
							break;
						default:
							break;
						}
					}
					if (iSchool == 2)
						school = lex.getLexemeText();
					if (iMajor == 2)
						major = lex.getLexemeText();
					/*
					 * if (iDegree == 1) degree = lex.getLexemeText();
					 */

				}
				EducationNow education = new EducationNow();
				String text = sList.get(i);
				education.setStartTime(getStartTime(text));
				String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
				education.setEndTime(getStartTime(textSen));
				education.setSchool(school);
				if (education.getSchool().length() > 22) {
					education.setSchool(education.getSchool().substring(0, 21));
				}
				education.setMajor(major);
				BasicDE basicDE = new BasicDE();
				if (degree.contains("专科") || degree.contains("大专")) {
					basicDE.setId(3);
				} else if (degree.contains("本科") || degree.contains("学士")) {
					basicDE.setId(4);
				} else if (degree.contains("硕士") || degree.contains("研究生")) {
					basicDE.setId(5);
				} else if (degree.contains("博士")) {
					basicDE.setId(6);
				} else if (degree.contains("博士后")) {
					basicDE.setId(7);
				}
				education.setDegree(basicDE);
				int staIndex = edu.indexOf(sList.get(i));
				int endIndex = staIndex;
				String subInfo = "";
				String infoFirst = "";
				if ((i + 1) < sList.size()) {
					endIndex = edu.indexOf(sList.get(i + 1));
					subInfo = edu.substring(staIndex, endIndex + sList.get(i + 1).length());
					infoFirst = edu.substring(endIndex + sList.get(i + 1).length());
				} else {
					subInfo = edu.substring(staIndex, staIndex + sList.get(i).length());
					infoFirst = edu.substring(staIndex + sList.get(i).length());
				} 
				education.setInfo(infoFirst);
				education.setEducationInfo(info.trim());
				// System.out.println("education" + education.toString() );
				eList.add(education);
				education = null;
			}
			i += 2;
		}
		// map.setEducations(eList);
		int flag = 1;
		if (eList.size() > 0) {
			for (EducationNow eListOne : eList) {
				// System.out.println("school = " + eListOne.getSchool());
				// System.out.println("degree = " + eListOne.getDegree());
				// System.out.println("major = " + eListOne.getMajor());
				if ((eListOne.getSchool() == null || eListOne.getSchool().equals("")) && (eListOne.getDegree() == null)
						&& (eListOne.getMajor() == null || eListOne.getMajor().equals(""))) {
					flag = 0;
					// break;
				} else {
					flag = 1;
					break;
				}
			}
		} else {
			flag = 0;
		}
		iList = null;
		sList = null;
		eList = null;
		return flag;
	}
	
	@Test
	public void test003(){
		String str = "2000认证)2003/05";
		String str2 = "2000认证)2003/0511111111111111111";
		System.out.println(str2.replace(str, ""));
	}
	
	/**
	 * 函数名：parseJob() * 功 能：识别工作经历信息块的起止时间、公司、部门、职位、 汇报对象、工作地点、工作职责、业绩、离职原因等。
	 * 
	 * @throws IOException
	 * 
	 */
	private int checkJob(String info, CVObject map) throws IOException {
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<Job> jList = new ArrayList<Job>();
		Pattern pattern = Pattern.compile( //
				"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
						+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
						+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
						+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
						+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
						+ "((19\\d{2}|20\\d{2})\\s*年)|" //
						+ "((19\\d{2}|20\\d{2}))");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}
		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i + 1) - iList.get(i) >= 15) {
				iList.set(i, info.length() * 2);
				i++;
			} else {
				i = i + 2;
			}
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i) == info.length() * 2) {
				iList.remove(i);
				sList.remove(i);
			} else {
				i++;
			}
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}

		if (iList.size() % 2 == 1) {
			iList.remove(iList.size() - 1);
			sList.remove(sList.size() - 1);
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}

		// 处理只有年份的情况
		if (iList.size() < 2) {
			Pattern pattern1 = Pattern.compile(
					"((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))|现在|至今|到现在|目前 |今| ");
			Matcher matcher1 = pattern1.matcher(info);
			while (matcher1.find()) {
				String str = matcher1.group();
				sList.add(str);
				iList.add(matcher1.start());
			}

			for (Integer iListOne : iList) {
				// System.out.println(iListOne);
			}
			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i + 1) - iList.get(i) >= 15) {
					iList.set(i, info.length() * 2);
					i++;
				} else {
					i = i + 2;
				}
			}

			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i) == info.length() * 2) {
					iList.remove(i);
					sList.remove(i);
				} else {
					i++;
				}
			}

			if (iList.size() % 2 == 1) {
				iList.remove(iList.size() - 1);
				sList.remove(sList.size() - 1);
			}
		}

		int length = info.length();
		String job = "";
		Lexeme lex = null;
		String temp = "";
		int type = 0;
		int iCompany, iTitle, iReport, iMember, iDuty, iOther, iAchieve, iReason, iCity, iDepartment;
		boolean bCompany, bTitle, bReport, bMember, bDuty, bOther, bAchieve, bReason, bCity, bDepartment;
		for (int i = 0, len = iList.size(); i < len;) {
			if (iList.size() > 2) {
				if (i == 0) {
					iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther = iAchieve = iReason = iCity = 0;
					bDepartment = bCompany = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
					StringBuffer sCompany = new StringBuffer();
					StringBuffer sTitle = new StringBuffer();
					StringBuffer sReport = new StringBuffer();
					StringBuffer sMember = new StringBuffer();
					StringBuffer sDuty = new StringBuffer();
					StringBuffer sOther = new StringBuffer();
					StringBuffer sAchieve = new StringBuffer();
					StringBuffer sReason = new StringBuffer();
					StringBuffer sCity = new StringBuffer();
					StringBuffer sDepartment = new StringBuffer();
					job = info.substring(iList.get(i), iList.get(i + 2));
					StringReader sr = new StringReader(job);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iDepartment--;
						iCompany--;
						iTitle--;
						iReport--;
						iMember--;
						iDuty--;
						iOther--;
						iAchieve--;
						iReason--;
						iCity--;
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							/*
							 * case 208: bCompany = true; iCompany = 2;
							 * bDepartment =bTitle = bReport = bMember = bDuty =
							 * bOther = bAchieve = bReason = bCity = false;
							 * break; //
							 */
							case 15:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 3:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							/*
							 * case 209: bTitle = true; iTitle = 2; bDepartment
							 * =bCompany = bReport = bMember = bDuty = bOther =
							 * bAchieve = bReason = bCity = false; break; //
							 */
							case 14:
								bTitle = true;
								iTitle = 3;
								bDepartment = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 300:
								bMember = true;
								iMember = 2;
								bDepartment = bTitle = bCompany = bReport = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 301:
								bDuty = true;
								iDuty = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bOther = bAchieve = bReason = bCity = false;
								break;
							case 302:
								bAchieve = true;
								iAchieve = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bReason = bCity = false;
								break;
							case 303:
								bReason = true;
								iReason = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bCity = false;
								break;
							case 304:
								bCity = true;
								iCity = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = false;
								break;
							case 306:
								bReport = true;
								iReport = 2;
								bDepartment = bTitle = bCompany = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 307:
								bOther = true;
								iOther = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							case 308:
								bDepartment = true;
								iDepartment = 2;
								bOther = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							default:
								break;
							}
						}
						if (bDepartment && (iDepartment == 1)) {
							if (sDepartment.length() <= 10) {
								sDepartment.append(temp);
								iDepartment = 2;
							} else {
								bDepartment = false;
							}
						}
						if (bCompany && (iCompany == 1)) {
							if (sCompany.length() <= 15) {
								sCompany.append(temp);
								iCompany = 2;
							} else {
								bCompany = false;
							}
						}
						if (bCompany && (iCompany == 3)) {
							if (sCompany.length() == 0) {
								sCompany.append(temp);
								iCompany = 0;
								bCompany = false;
							}
						}
						/*
						 * if (bTitle && (iTitle == 1)) {
						 * if(sTitle.length()<=10) { sTitle.append(temp); iTitle
						 * = 2; }else{ bTitle = false; } } //
						 */
						if (bTitle && (iTitle == 3)) {
							// System.out.println("find title");
							if (sTitle.length() == 0) {
								// System.out.println("add title");
								sTitle.append(temp);
								iTitle = 0;
								bTitle = false;
							}
						}
						if (bReport && (iReport == 1)) {
							sReport.append(temp);
							iReport = 2;
						}
						if (bMember && (iMember == 1)) {
							sMember.append(temp);
							iMember = 2;
						}
						if (bDuty && (iDuty == 1)) {
							sDuty.append(temp);
							iDuty = 2;
						}
						if (bOther && (iOther == 1)) {
							sOther.append(temp);
							iOther = 2;
						}
						if (bAchieve && (iAchieve == 1)) {
							sAchieve.append(temp);
							iAchieve = 2;
						}
						if (bReason && (iReason == 1)) {
							sReason.append(temp);
							iReason = 2;
						}
						if (bCity && (iCity == 1)) {
							if (sCity.length() <= 8) {
								sCity.append(temp);
								iCity = 2;
							} else {
								bCity = false;
							}
						}
					}
					Job jobinfo = new Job();
					String text = sList.get(i);
					jobinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					jobinfo.setEndTime(getStartTime(textSen));
					jobinfo.setAchieve(sAchieve.toString());
					jobinfo.setCity(sCity.toString());
					jobinfo.setCompany(sCompany.toString());
					if (jobinfo.getCompany().length() > 50) {
						jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
					}
					jobinfo.setDuty(sDuty.toString());
					jobinfo.setDepartment(sDepartment.toString());
					jobinfo.setReport(sReport.toString());
					jobinfo.setReason(sReason.toString());
					jobinfo.setMember(sMember.toString());
					jobinfo.setTitle(sTitle.toString());
					if (jobinfo.getTitle().length() > 12) {
						jobinfo.setTitle(jobinfo.getTitle().substring(0, 11));
					}
					jobinfo.setInfo(
							sDepartment.toString() + sReport.toString() + sDuty.toString() + sReason.toString());
					jobinfo.setJobInfo(info.trim());
					// System.out.println("jobinfo" + jobinfo.toString() );
					if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
						if (jobinfo.getTitle() == null || jobinfo.getTitle().equals("")) {
							List<Integer> iList1 = new ArrayList<Integer>();
							List<String> sList1 = new ArrayList<String>();
							String tempjob = job;
							Pattern pattern1 = Pattern.compile( //
									"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
											+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
											+ "((19\\d{2}|20\\d{2})\\s*年)|" //
											+ "((19\\d{2}|20\\d{2}))");
							Matcher matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								String str = matcher1.group();
								tempjob = tempjob.replaceAll(str, "");
								tempjob = tempjob.replaceAll("-|\\/|\\|\\.", "");
							}
							pattern1 = Pattern.compile("股份有限公司|有限责任公司|有限公司");
							matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								jobinfo.setCompany(tempjob.substring(0, matcher1.start()) + matcher1.group());
								break;
							}
						} else {
							List<Integer> iList1 = new ArrayList<Integer>();
							List<String> sList1 = new ArrayList<String>();
							String tempjob = job;
							Pattern pattern1 = Pattern.compile( //
									"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
											+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
											+ "((19\\d{2}|20\\d{2})\\s*年)|" //
											+ "((19\\d{2}|20\\d{2}))");
							Matcher matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								String str = matcher1.group();
								tempjob = tempjob.replaceAll(str, "");
								tempjob = tempjob.replaceAll("-|\\/|\\|\\.", "");
							}
							pattern1 = Pattern.compile(jobinfo.getTitle());
							matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								jobinfo.setCompany(tempjob.substring(0, matcher1.start()));
								if (jobinfo.getCompany().length() > 50) {
									jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
								}
								break;
							}
						}
					}
					jList.add(jobinfo);
					sDepartment = sAchieve = sCity = sCompany = sDuty = sMember = sReport = sReason = sMember = sTitle = null;
					jobinfo = null;
				} else if (i < len - 3) {
					iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther = iAchieve = iReason = iCity = 0;
					bDepartment = bCompany = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
					StringBuffer sCompany = new StringBuffer();
					StringBuffer sTitle = new StringBuffer();
					StringBuffer sReport = new StringBuffer();
					StringBuffer sMember = new StringBuffer();
					StringBuffer sDuty = new StringBuffer();
					StringBuffer sOther = new StringBuffer();
					StringBuffer sAchieve = new StringBuffer();
					StringBuffer sReason = new StringBuffer();
					StringBuffer sCity = new StringBuffer();
					StringBuffer sDepartment = new StringBuffer();
					job = info.substring(iList.get(i), iList.get(i + 2));
					StringReader sr = new StringReader(job);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iDepartment--;
						iCompany--;
						iTitle--;
						iReport--;
						iMember--;
						iDuty--;
						iOther--;
						iAchieve--;
						iReason--;
						iCity--;
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							/*
							 * case 208: bCompany = true; iCompany = 2;
							 * bDepartment =bTitle = bReport = bMember = bDuty =
							 * bOther = bAchieve = bReason = bCity = false;
							 * break; //
							 */
							case 15:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 3:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							/*
							 * case 209: bTitle = true; iTitle = 2; bDepartment
							 * =bCompany = bReport = bMember = bDuty = bOther =
							 * bAchieve = bReason = bCity = false; break; //
							 */
							case 14:
								bTitle = true;
								iTitle = 3;
								bDepartment = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 300:
								bMember = true;
								iMember = 2;
								bDepartment = bTitle = bCompany = bReport = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 301:
								bDuty = true;
								iDuty = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bOther = bAchieve = bReason = bCity = false;
								break;
							case 302:
								bAchieve = true;
								iAchieve = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bReason = bCity = false;
								break;
							case 303:
								bReason = true;
								iReason = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bCity = false;
								break;
							case 304:
								bCity = true;
								iCity = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = false;
								break;
							case 306:
								bReport = true;
								iReport = 2;
								bDepartment = bTitle = bCompany = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 307:
								bOther = true;
								iOther = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							case 308:
								bDepartment = true;
								iDepartment = 2;
								bOther = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							default:
								break;
							}
						}
						if (bDepartment && (iDepartment == 1)) {
							if (sDepartment.length() <= 10) {
								sDepartment.append(temp);
								iDepartment = 2;
							} else {
								bDepartment = false;
							}
						}
						if (bCompany && (iCompany == 1)) {
							if (sCompany.length() <= 15) {
								sCompany.append(temp);
								iCompany = 2;
							} else {
								bCompany = false;
							}
						}
						if (bCompany && (iCompany == 3)) {
							if (sCompany.length() == 0) {
								sCompany.append(temp);
								iCompany = 0;
								bCompany = false;
							}
						}
						/*
						 * if (bTitle && (iTitle == 1)) {
						 * if(sTitle.length()<=10) { sTitle.append(temp); iTitle
						 * = 2; }else{ bTitle = false; } } //
						 */
						if (bTitle && (iTitle == 3)) {
							// System.out.println("find title");
							if (sTitle.length() == 0) {
								// System.out.println("add title");
								sTitle.append(temp);
								iTitle = 0;
								bTitle = false;
							}
						}
						if (bReport && (iReport == 1)) {
							sReport.append(temp);
							iReport = 2;
						}
						if (bMember && (iMember == 1)) {
							sMember.append(temp);
							iMember = 2;
						}
						if (bDuty && (iDuty == 1)) {
							sDuty.append(temp);
							iDuty = 2;
						}
						if (bOther && (iOther == 1)) {
							sOther.append(temp);
							iOther = 2;
						}
						if (bAchieve && (iAchieve == 1)) {
							sAchieve.append(temp);
							iAchieve = 2;
						}
						if (bReason && (iReason == 1)) {
							sReason.append(temp);
							iReason = 2;
						}
						if (bCity && (iCity == 1)) {
							if (sCity.length() <= 8) {
								sCity.append(temp);
								iCity = 2;
							} else {
								bCity = false;
							}
						}

					}
					Job jobinfo = new Job();
					String text = sList.get(i);
					jobinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					jobinfo.setEndTime(getStartTime(textSen));
					jobinfo.setAchieve(sAchieve.toString());
					jobinfo.setCity(sCity.toString());
					jobinfo.setCompany(sCompany.toString());
					if (jobinfo.getCompany().length() > 50) {
						jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
					}
					jobinfo.setDuty(sDuty.toString());
					jobinfo.setDepartment(sDepartment.toString());
					jobinfo.setReport(sReport.toString());
					jobinfo.setReason(sReason.toString());
					jobinfo.setMember(sMember.toString());
					jobinfo.setTitle(sTitle.toString());
					if (jobinfo.getTitle().length() > 12) {
						jobinfo.setTitle(jobinfo.getTitle().substring(0, 11));
					}
					jobinfo.setInfo(
							sDepartment.toString() + sReport.toString() + sDuty.toString() + sReason.toString());
					jobinfo.setJobInfo(info.trim());
					// System.out.println("jobinfo" + jobinfo.toString() );
					if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
						if (jobinfo.getTitle() == null || jobinfo.getTitle().equals("")) {
							List<Integer> iList1 = new ArrayList<Integer>();
							List<String> sList1 = new ArrayList<String>();
							String tempjob = job;
							Pattern pattern1 = Pattern.compile( //
									"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
											+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
											+ "((19\\d{2}|20\\d{2})\\s*年)|" //
											+ "((19\\d{2}|20\\d{2}))");
							Matcher matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								String str = matcher1.group();
								tempjob = tempjob.replaceAll(str, "");
								tempjob = tempjob.replaceAll("-|\\/|\\|\\.", "");
							}
							pattern1 = Pattern.compile("股份有限公司|有限责任公司|有限公司");
							matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								jobinfo.setCompany(tempjob.substring(0, matcher1.start()) + matcher1.group());
								break;
							}
						} else {
							List<Integer> iList1 = new ArrayList<Integer>();
							List<String> sList1 = new ArrayList<String>();
							String tempjob = job;
							Pattern pattern1 = Pattern.compile( //
									"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
											+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
											+ "((19\\d{2}|20\\d{2})\\s*年)|" //
											+ "((19\\d{2}|20\\d{2}))");
							Matcher matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								String str = matcher1.group();
								tempjob = tempjob.replaceAll(str, "");
								tempjob = tempjob.replaceAll("-|\\/|\\|\\.", "");
							}
							pattern1 = Pattern.compile(jobinfo.getTitle());
							matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								jobinfo.setCompany(tempjob.substring(0, matcher1.start()));
								if (jobinfo.getCompany().length() > 50) {
									jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
								}
								break;
							}
						}
					}
					jList.add(jobinfo);
					sDepartment = sAchieve = sCity = sCompany = sDuty = sMember = sReport = sReason = sMember = sTitle = null;
					jobinfo = null;
				} else {
					iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther = iAchieve = iReason = iCity = 0;
					bDepartment = bCompany = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
					StringBuffer sCompany = new StringBuffer();
					StringBuffer sTitle = new StringBuffer();
					StringBuffer sReport = new StringBuffer();
					StringBuffer sMember = new StringBuffer();
					StringBuffer sDuty = new StringBuffer();
					StringBuffer sOther = new StringBuffer();
					StringBuffer sAchieve = new StringBuffer();
					StringBuffer sReason = new StringBuffer();
					StringBuffer sCity = new StringBuffer();
					StringBuffer sDepartment = new StringBuffer();
					job = info.substring(iList.get(i), length);
					StringReader sr = new StringReader(job);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iDepartment--;
						iCompany--;
						iTitle--;
						iReport--;
						iMember--;
						iDuty--;
						iOther--;
						iAchieve--;
						iReason--;
						iCity--;
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							/*
							 * case 208: bCompany = true; iCompany = 2;
							 * bDepartment =bTitle = bReport = bMember = bDuty =
							 * bOther = bAchieve = bReason = bCity = false;
							 * break; //
							 */
							case 15:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 3:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							/*
							 * case 209: bTitle = true; iTitle = 2; bDepartment
							 * =bCompany = bReport = bMember = bDuty = bOther =
							 * bAchieve = bReason = bCity = false; break; //
							 */
							case 14:
								bTitle = true;
								iTitle = 3;
								bDepartment = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 300:
								bMember = true;
								iMember = 2;
								bDepartment = bTitle = bCompany = bReport = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 301:
								bDuty = true;
								iDuty = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bOther = bAchieve = bReason = bCity = false;
								break;
							case 302:
								bAchieve = true;
								iAchieve = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bReason = bCity = false;
								break;
							case 303:
								bReason = true;
								iReason = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bCity = false;
								break;
							case 304:
								bCity = true;
								iCity = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = false;
								break;
							case 306:
								bReport = true;
								iReport = 2;
								bDepartment = bTitle = bCompany = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 307:
								bOther = true;
								iOther = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							case 308:
								bDepartment = true;
								iDepartment = 2;
								bOther = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							default:
								break;
							}
						}
						if (bDepartment && (iDepartment == 1)) {
							if (sDepartment.length() <= 10) {
								sDepartment.append(temp);
								iDepartment = 2;
							} else {
								bDepartment = false;
							}
						}
						if (bCompany && (iCompany == 1)) {
							if (sCompany.length() <= 15) {
								sCompany.append(temp);
								iCompany = 2;
							} else {
								bCompany = false;
							}
						}
						if (bCompany && (iCompany == 3)) {
							if (sCompany.length() == 0) {
								sCompany.append(temp);
								iCompany = 0;
								bCompany = false;
							}
						}
						/*
						 * if (bTitle && (iTitle == 1)) {
						 * if(sTitle.length()<=10) { sTitle.append(temp); iTitle
						 * = 2; }else{ bTitle = false; } } //
						 */
						if (bTitle && (iTitle == 3)) {
							// System.out.println("find title");
							if (sTitle.length() == 0) {
								// System.out.println("add title");
								sTitle.append(temp);
								iTitle = 0;
								bTitle = false;
							}
						}
						if (bReport && (iReport == 1)) {
							sReport.append(temp);
							iReport = 2;
						}
						if (bMember && (iMember == 1)) {
							sMember.append(temp);
							iMember = 2;
						}
						if (bDuty && (iDuty == 1)) {
							sDuty.append(temp);
							iDuty = 2;
						}
						if (bOther && (iOther == 1)) {
							sOther.append(temp);
							iOther = 2;
						}
						if (bAchieve && (iAchieve == 1)) {
							sAchieve.append(temp);
							iAchieve = 2;
						}
						if (bReason && (iReason == 1)) {
							sReason.append(temp);
							iReason = 2;
						}
						if (bCity && (iCity == 1)) {
							if (sCity.length() <= 8) {
								sCity.append(temp);
								iCity = 2;
							} else {
								bCity = false;
							}
						}
					}
					Job jobinfo = new Job();
					String text = sList.get(i);
					jobinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					jobinfo.setEndTime(getStartTime(textSen));
					jobinfo.setAchieve(sAchieve.toString());
					jobinfo.setCity(sCity.toString());
					jobinfo.setCompany(sCompany.toString());
					if (jobinfo.getCompany().length() > 50) {
						jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
					}
					jobinfo.setDuty(sDuty.toString());
					jobinfo.setDepartment(sDepartment.toString());
					jobinfo.setReport(sReport.toString());
					jobinfo.setReason(sReason.toString());
					jobinfo.setMember(sMember.toString());
					jobinfo.setTitle(sTitle.toString());
					if (jobinfo.getTitle().length() > 12) {
						jobinfo.setTitle(jobinfo.getTitle().substring(0, 11));
					}
					jobinfo.setInfo(
							sDepartment.toString() + sReport.toString() + sDuty.toString() + sReason.toString());
					jobinfo.setJobInfo(info.trim());
					// System.out.println("jobinfo" + jobinfo.toString() );
					if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
						if (jobinfo.getTitle() == null || jobinfo.getTitle().equals("")) {
							List<Integer> iList1 = new ArrayList<Integer>();
							List<String> sList1 = new ArrayList<String>();
							String tempjob = job;
							Pattern pattern1 = Pattern.compile( //
									"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
											+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
											+ "((19\\d{2}|20\\d{2})\\s*年)|" //
											+ "((19\\d{2}|20\\d{2}))");
							Matcher matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								String str = matcher1.group();
								tempjob = tempjob.replaceAll(str, "");
								tempjob = tempjob.replaceAll("-|\\/|\\|\\.", "");
							}
							pattern1 = Pattern.compile("股份有限公司|有限责任公司|有限公司");
							matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								jobinfo.setCompany(tempjob.substring(0, matcher1.start()) + matcher1.group());
								break;
							}
						} else {
							List<Integer> iList1 = new ArrayList<Integer>();
							List<String> sList1 = new ArrayList<String>();
							String tempjob = job;
							Pattern pattern1 = Pattern.compile( //
									"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
											+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
											+ "((19\\d{2}|20\\d{2})\\s*年)|" //
											+ "((19\\d{2}|20\\d{2}))");
							Matcher matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								String str = matcher1.group();
								tempjob = tempjob.replaceAll(str, "");
								tempjob = tempjob.replaceAll("-|\\/|\\|\\.", "");
							}
							pattern1 = Pattern.compile(jobinfo.getTitle());
							matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								jobinfo.setCompany(tempjob.substring(0, matcher1.start()));
								if (jobinfo.getCompany().length() > 50) {
									jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
								}
								break;
							}
						}
					}
					jList.add(jobinfo);
					sDepartment = sAchieve = sCity = sCompany = sDuty = sMember = sReport = sReason = sMember = sTitle = null;
					jobinfo = null;
				}
			} else {
				iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther = iAchieve = iReason = iCity = 0;
				bDepartment = bCompany = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
				StringBuffer sCompany = new StringBuffer();
				StringBuffer sTitle = new StringBuffer();
				StringBuffer sReport = new StringBuffer();
				StringBuffer sMember = new StringBuffer();
				StringBuffer sDuty = new StringBuffer();
				StringBuffer sOther = new StringBuffer();
				StringBuffer sAchieve = new StringBuffer();
				StringBuffer sReason = new StringBuffer();
				StringBuffer sCity = new StringBuffer();
				StringBuffer sDepartment = new StringBuffer();
				job = info.substring(0, length);
				StringReader sr = new StringReader(job);
				IKSegmenter ik = new IKSegmenter(sr, true);
				while ((lex = ik.next()) != null) {
					iDepartment--;
					iCompany--;
					iTitle--;
					iReport--;
					iMember--;
					iDuty--;
					iOther--;
					iAchieve--;
					iReason--;
					iCity--;
					temp = lex.getLexemeText();
					// System.out.println(temp);
					if (m_UserDic.containsKey(temp)) {
						type = m_UserDic.get(temp);
						switch (type) {
						/*
						 * case 208: bCompany = true; iCompany = 2; bDepartment
						 * =bTitle = bReport = bMember = bDuty = bOther =
						 * bAchieve = bReason = bCity = false; break; //
						 */
						case 15:
							bCompany = true;
							iCompany = 3;
							bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						case 3:
							bCompany = true;
							iCompany = 3;
							bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						/*
						 * case 209: bTitle = true; iTitle = 2; bDepartment
						 * =bCompany = bReport = bMember = bDuty = bOther =
						 * bAchieve = bReason = bCity = false; break; //
						 */
						case 14:
							bTitle = true;
							iTitle = 3;
							bDepartment = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						case 300:
							bMember = true;
							iMember = 2;
							bDepartment = bTitle = bCompany = bReport = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						case 301:
							bDuty = true;
							iDuty = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bOther = bAchieve = bReason = bCity = false;
							break;
						case 302:
							bAchieve = true;
							iAchieve = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bReason = bCity = false;
							break;
						case 303:
							bReason = true;
							iReason = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bCity = false;
							break;
						case 304:
							bCity = true;
							iCity = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = false;
							break;
						case 306:
							bReport = true;
							iReport = 2;
							bDepartment = bTitle = bCompany = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						case 307:
							bOther = true;
							iOther = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
							break;
						case 308:
							bDepartment = true;
							iDepartment = 2;
							bOther = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
							break;
						default:
							break;
						}
					}
					if (bDepartment && (iDepartment == 1)) {
						if (sDepartment.length() <= 10) {
							sDepartment.append(temp);
							iDepartment = 2;
						} else {
							bDepartment = false;
						}
					}
					if (bCompany && (iCompany == 1)) {
						if (sCompany.length() <= 15) {
							sCompany.append(temp);
							iCompany = 2;
						} else {
							bCompany = false;
						}
					}
					if (bCompany && (iCompany == 3)) {
						// System.out.println("find title");
						if (sCompany.length() == 0) {
							// System.out.println("add title");
							sCompany.append(temp);
							iCompany = 0;
							bCompany = false;
						}
					}
					/*
					 * if (bTitle && (iTitle == 1)) { if(sTitle.length()<=10) {
					 * sTitle.append(temp); iTitle = 2; }else{ bTitle = false; }
					 * } //
					 */
					if (bTitle && (iTitle == 3)) {
						if (sTitle.length() == 0) {
							sTitle.append(temp);
							iTitle = 0;
							bTitle = false;
						}
					}
					if (bReport && (iReport == 1)) {
						sReport.append(temp);
						iReport = 2;
					}
					if (bMember && (iMember == 1)) {
						sMember.append(temp);
						iMember = 2;
					}
					if (bDuty && (iDuty == 1)) {
						sDuty.append(temp);
						iDuty = 2;
					}
					if (bOther && (iOther == 1)) {
						sOther.append(temp);
						iOther = 2;
					}
					if (bAchieve && (iAchieve == 1)) {
						sAchieve.append(temp);
						iAchieve = 2;
					}
					if (bReason && (iReason == 1)) {
						sReason.append(temp);
						iReason = 2;
					}
					if (bCity && (iCity == 1)) {
						if (sCity.length() <= 8) {
							sCity.append(temp);
							iCity = 2;
						} else {
							bCity = false;
						}
					}
				}
				Job jobinfo = new Job();
				String text = sList.get(i);
				jobinfo.setStartTime(getStartTime(text));
				String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
				jobinfo.setEndTime(getStartTime(textSen));
				jobinfo.setAchieve(sAchieve.toString());
				jobinfo.setCity(sCity.toString());
				jobinfo.setCompany(sCompany.toString());
				if (jobinfo.getCompany().length() > 50) {
					jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
				}
				jobinfo.setDuty(sDuty.toString());
				jobinfo.setDepartment(sDepartment.toString());
				jobinfo.setReport(sReport.toString());
				jobinfo.setReason(sReason.toString());
				jobinfo.setMember(sMember.toString());
				jobinfo.setTitle(sTitle.toString());
				if (jobinfo.getTitle().length() > 12) {
					jobinfo.setTitle(jobinfo.getTitle().substring(0, 11));
				}
				jobinfo.setInfo(sDepartment.toString() + sReport.toString() + sDuty.toString() + sReason.toString());
				jobinfo.setJobInfo(info.trim());
				// System.out.println("jobinfo" + jobinfo.toString() );
				if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
					if (jobinfo.getTitle() == null || jobinfo.getTitle().equals("")) {
						List<Integer> iList1 = new ArrayList<Integer>();
						List<String> sList1 = new ArrayList<String>();
						String tempjob = job;
						Pattern pattern1 = Pattern.compile( //
								"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
										+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
										+ "((19\\d{2}|20\\d{2})\\s*年)|" //
										+ "((19\\d{2}|20\\d{2}))");
						Matcher matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							String str = matcher1.group();
							tempjob = tempjob.replaceAll(str, "");
							tempjob = tempjob.replaceAll("-|\\/|\\|\\.", "");
						}
						pattern1 = Pattern.compile("股份有限公司|有限责任公司|有限公司");
						matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							jobinfo.setCompany(tempjob.substring(0, matcher1.start()) + matcher1.group());
							break;
						}
					} else {
						List<Integer> iList1 = new ArrayList<Integer>();
						List<String> sList1 = new ArrayList<String>();
						String tempjob = job;
						Pattern pattern1 = Pattern.compile( //
								"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
										+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
										+ "((19\\d{2}|20\\d{2})\\s*年)|" //
										+ "((19\\d{2}|20\\d{2}))");
						Matcher matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							String str = matcher1.group();
							tempjob = tempjob.replaceAll(str, "");
							tempjob = tempjob.replaceAll("-|\\/|\\|\\.", "");
						}
						pattern1 = Pattern.compile(jobinfo.getTitle());
						matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							jobinfo.setCompany(tempjob.substring(0, matcher1.start()));
							if (jobinfo.getCompany().length() > 50) {
								jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
							}
							break;
						}
					}
				}
				jList.add(jobinfo);
				sDepartment = sAchieve = sCity = sCompany = sDuty = sMember = sReport = sReason = sMember = sTitle = null;
				jobinfo = null;
			}
			i += 2;
		}

		int flag = 1;
		if (jList.size() > 0) {
			for (Job jListOne : jList) {
				// System.out.println("company = " + jListOne.getCompany());
				// System.out.println("duty = " + jListOne.getDuty());
				// System.out.println("title = " + jListOne.getTitle());
				// System.out.println("department = " +
				// jListOne.getDepartment());
				// System.out.println("jobinfo = " + jListOne.getJobInfo());
				if ((jListOne.getCompany() == null || jListOne.getCompany().equals(""))
						&& (jListOne.getDuty() == null || jListOne.getDuty().equals(""))
						&& (jListOne.getTitle() == null || jListOne.getTitle().equals(""))
						&& (jListOne.getDepartment() == null || jListOne.getDepartment().equals(""))) {
					flag = 0;
					// break;
				} else {
					flag = 1;
					break;
				}
			}
		} else {
			// System.out.println("jList size = 0");
			flag = 0;
		}
		// System.out.println("flag job = " + flag);
		// map.setJobs(jList);
		iList = null;
		sList = null;
		jList = null;
		// System.out.println("flag = " + flag);
		return flag;
	}

	/**
	 * 函数名：parseProject() 功 能：识别项目经历信息块的起止时间、公司、部门、职位、 项目职责、业绩、项目内容等
	 * 
	 * @throws IOException
	 */
	private int checkProject(String info, CVObject map) throws IOException {

		info = info.replaceAll("||    |||", "");
		List<Integer> iList = new ArrayList<Integer>(); // 项目起始时间索引
		List<String> sList = new ArrayList<String>(); // 项目起始时间
		List<Project> pList = new ArrayList<Project>(); // 项目列表
		// 处理包含年和月的情况
		Pattern pattern = Pattern.compile(
				"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}
		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i + 1) - iList.get(i) >= 15) {
				iList.set(i, info.length() * 2);
				i++;
			} else {
				i = i + 2;
			}
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i) == info.length() * 2) {
				iList.remove(i);
				sList.remove(i);
			} else {
				i++;
			}
		}

		if (iList.size() % 2 == 1) {
			iList.remove(iList.size() - 1);
			sList.remove(sList.size() - 1);
		}

		// 处理只有年份的情况
		if (iList.size() < 2) {
			Pattern pattern1 = Pattern.compile(
					"((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))|现在|至今|到现在|目前 ");
			Matcher matcher1 = pattern1.matcher(info);
			while (matcher1.find()) {
				String str = matcher1.group();
				sList.add(str);
				iList.add(matcher1.start());
			}

			for (Integer iListOne : iList) {
				// System.out.println(iListOne);
			}
			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i + 1) - iList.get(i) >= 15) {
					iList.set(i, info.length() * 2);
					i++;
				} else {
					i = i + 2;
				}
			}

			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i) == info.length() * 2) {
					iList.remove(i);
					sList.remove(i);
				} else {
					i++;
				}
			}
			// 去除奇数，构成偶数对起始时间
			if (iList.size() % 2 == 1) {
				iList.remove(iList.size() - 1);
				sList.remove(sList.size() - 1);
			}
		}

		int length = info.length();
		String project = "";
		Lexeme lex = null;
		String temp = "";
		int type = 0;
		int iCompany, iProject_name, iContent, iDuty, iAchieve, iCity;
		iCompany = iProject_name = iContent = iDuty = iAchieve = iCity = 0;
		boolean bCompany, bProject_name, bContent, bDuty, bAchieve, bCity;
		bCompany = bProject_name = bContent = bDuty = bAchieve = bCity = false;
		for (int i = 0, len = iList.size(); i < len;) {
			// System.out.println("project = " + project);
			if (iList.size() > 2) {
				if (i == 0) {
					String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
					project = info.substring(iList.get(0), iList.get(2));
					// System.out.println("project before = " + project);
					/// *
					pattern = Pattern.compile(
							"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
					matcher = pattern.matcher(project);
					int templocation = 0;
					int tempcount = 0;
					while (matcher.find()) {
						tempcount++;
						if (tempcount == 2) {
							templocation = matcher.end(); // 提取起始时间
							break;
						}
					}
					project = project.substring(templocation, project.length()); // 提取项目内容

					// 细化项目各项
					List<Integer> tempiList = new ArrayList<Integer>(); // 存储项目分段位置索引
					List<String> tempsList = new ArrayList<String>(); // 存储匹配类型
					// List<Medal> tempmList = new ArrayList<Medal>(); //
					pattern = Pattern.compile(
							"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
					matcher = pattern.matcher(project);
					int projectNameFlag = 0;
					while (matcher.find()) {
						String str = matcher.group();
						tempsList.add(str);
						tempiList.add(matcher.start());
						if (str.equals("项目名称") || str.equals("名称")) {
							projectNameFlag = 1;
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							// System.out.println(project.substring(tempiList.get(tempi),
							// project.length()));
						} else {
							// System.out.println(project.substring(tempiList.get(tempi),
							// tempiList.get(tempi+1)));
						}
					}
					Project projectinfo = new Project();
					String text = sList.get(i);
					projectinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					projectinfo.setEndTime(getStartTime(textSen));
					// 若无匹配结果，直接全部塞进projectinfo
					if (projectNameFlag == 0) {
						if (tempiList.size() == 0) {
							projectinfo.setInfo(project.substring(0, project.length()));
						} else {
							projectinfo.setInfo(project.substring(0, tempiList.get(0)));
						}
					}

					// 取出项目各项
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
							}
						} else {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo
										.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo
										.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							}
						}
					}

					pList.add(projectinfo);
					projectinfo = null;
				} else if (i < len - 3) { // i>0
					String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
					project = info.substring(iList.get(i), iList.get(i + 2));
					// System.out.println("project before = " + project);
					/// *
					pattern = Pattern.compile(
							"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
					matcher = pattern.matcher(project);
					int templocation = 0;
					int tempcount = 0;
					while (matcher.find()) {
						// String str = matcher.group();
						// sList.add(str);
						// iList.add(matcher.start());
						tempcount++;
						if (tempcount == 2) {
							templocation = matcher.end();
							break;
						}
					}
					project = project.substring(templocation, project.length());
					// */
					// System.out.println("project after = " + project);

					List<Integer> tempiList = new ArrayList<Integer>();
					List<String> tempsList = new ArrayList<String>();
					List<Medal> tempmList = new ArrayList<Medal>();
					pattern = Pattern.compile(
							"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
					matcher = pattern.matcher(project);
					int projectNameFlag = 0;
					while (matcher.find()) {
						String str = matcher.group();
						tempsList.add(str);
						tempiList.add(matcher.start());
						if (str.equals("项目名称") || str.equals("名称")) {
							projectNameFlag = 1;
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							// System.out.println(project.substring(tempiList.get(tempi),
							// project.length()));
						} else {
							// System.out.println(project.substring(tempiList.get(tempi),
							// tempiList.get(tempi+1)));
						}
					}
					Project projectinfo = new Project();
					String text = sList.get(i);
					projectinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					projectinfo.setEndTime(getStartTime(textSen));
					if (projectNameFlag == 0) {
						if (tempiList.size() == 0) {
							projectinfo.setInfo(project.substring(0, project.length()));
						} else {
							projectinfo.setInfo(project.substring(0, tempiList.get(0)));
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
							}
						} else {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo
										.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo
										.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							}
						}
					}

					pList.add(projectinfo);
					projectinfo = null;
				} else {
					String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
					project = info.substring(iList.get(i), length);
					// System.out.println("project before = " + project);
					/// *
					pattern = Pattern.compile(
							"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
					matcher = pattern.matcher(project);
					int templocation = 0;
					int tempcount = 0;
					while (matcher.find()) {
						// String str = matcher.group();
						// sList.add(str);
						// iList.add(matcher.start());
						tempcount++;
						if (tempcount == 2) {
							templocation = matcher.end();
							break;
						}
					}
					project = project.substring(templocation, project.length());
					// */
					// System.out.println("project after = " + project);

					List<Integer> tempiList = new ArrayList<Integer>();
					List<String> tempsList = new ArrayList<String>();
					List<Medal> tempmList = new ArrayList<Medal>();
					pattern = Pattern.compile(
							"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
					matcher = pattern.matcher(project);
					int projectNameFlag = 0;
					while (matcher.find()) {
						String str = matcher.group();
						tempsList.add(str);
						tempiList.add(matcher.start());
						if (str.equals("项目名称") || str.equals("名称")) {
							projectNameFlag = 1;
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							// System.out.println(project.substring(tempiList.get(tempi),
							// project.length()));
						} else {
							// System.out.println(project.substring(tempiList.get(tempi),
							// tempiList.get(tempi+1)));
						}
					}
					Project projectinfo = new Project();
					String text = sList.get(i);
					projectinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					projectinfo.setEndTime(getStartTime(textSen));
					if (projectNameFlag == 0) {
						if (tempiList.size() == 0) {
							projectinfo.setInfo(project.substring(0, project.length()));
						} else {
							projectinfo.setInfo(project.substring(0, tempiList.get(0)));
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
							}
						} else {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo
										.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo
										.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							}
						}
					}

					pList.add(projectinfo);
					projectinfo = null;
				}
			} else { // iList.size() <= 2
				String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
				project = info.substring(0, length);
				// System.out.println("project before = " + project);
				/// *
				pattern = Pattern.compile(
						"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
				matcher = pattern.matcher(project);
				int templocation = 0;
				int tempcount = 0;
				while (matcher.find()) {
					// String str = matcher.group();
					// sList.add(str);
					// iList.add(matcher.start());
					tempcount++;
					if (tempcount == 2) {
						templocation = matcher.end();
						break;
					}
				}
				project = project.substring(templocation, project.length());
				// */
				// System.out.println("project after = " + project);

				List<Integer> tempiList = new ArrayList<Integer>();
				List<String> tempsList = new ArrayList<String>();
				List<Medal> tempmList = new ArrayList<Medal>();
				pattern = Pattern.compile(
						"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
				matcher = pattern.matcher(project);
				int projectNameFlag = 0;
				while (matcher.find()) {
					String str = matcher.group();
					tempsList.add(str);
					tempiList.add(matcher.start());
					if (str.equals("项目名称") || str.equals("名称")) {
						projectNameFlag = 1;
					}
				}
				for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
					if (tempi >= templen - 1) {
						// System.out.println(project.substring(tempiList.get(tempi),
						// project.length()));
					} else {
						// System.out.println(project.substring(tempiList.get(tempi),
						// tempiList.get(tempi+1)));
					}
				}
				Project projectinfo = new Project();
				String text = sList.get(i);
				projectinfo.setStartTime(getStartTime(text));
				String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
				projectinfo.setEndTime(getStartTime(textSen));
				if (projectNameFlag == 0) {
					if (tempiList.size() == 0) {
						projectinfo.setInfo(project.substring(0, project.length()));
					} else {
						projectinfo.setInfo(project.substring(0, tempiList.get(0)));
					}
				}
				for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
					if (tempi >= templen - 1) {
						if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
							projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
						} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
								|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
							projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
						} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
								|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
								|| tempsList.get(tempi).equals("项目职责")) {
							projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
						}
					} else {
						if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
							projectinfo.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
						} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
								|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
							projectinfo.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
						} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
								|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
								|| tempsList.get(tempi).equals("项目职责")) {
							projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
						}
					}
				}

				/*
				 * StringReader sr = new StringReader(project); IKSegmenter ik =
				 * new IKSegmenter(sr, true); while ((lex = ik.next()) != null)
				 * { iCompany--; iProject_name--; iContent--; iDuty--;
				 * iAchieve--; iCity--; temp = lex.getLexemeText(); if
				 * (m_UserDic.containsKey(temp)) { type = m_UserDic.get(temp);
				 * switch (type) { case 208: //bCompany = true; //iCompany = 2;
				 * //bDuty = bProject_name = bAchieve = bContent = bCity =
				 * false; break; case 307: bProject_name = true; iProject_name =
				 * 2; bCompany =bDuty = bAchieve = bContent = bCity = false;
				 * break; case 306: bContent = true; iContent = 2; bProject_name
				 * =bCompany =bDuty = bAchieve = bCity = false; break; case 301:
				 * bDuty = true; iDuty = 2; bProject_name =bCompany =bAchieve =
				 * bContent = bCity = false; break; case 302: bAchieve = true;
				 * iAchieve = 2; bProject_name =bCompany =bDuty = bContent =
				 * bCity = false; break; case 203: bCity = true; iCity = 2;
				 * bProject_name =bCompany =bDuty = bAchieve = bContent = false;
				 * break; default: break; } } if (bCompany && (iCompany == 1)) {
				 * if(company.length()<=15) { company+=temp; iCompany = 2;
				 * }else{ bCompany = false; } } if ( bProject_name &&
				 * (iProject_name == 1)) { if(company.length()<=15) {
				 * project_name+=temp; iProject_name = 2; }else{ bProject_name =
				 * false; } } if (bContent && (iContent == 1)) { content+=temp;
				 * iContent = 2; } if ( bDuty && (iDuty == 1)) { duty+=temp;
				 * iDuty = 2; } if (bAchieve && (iAchieve == 1)) {
				 * achieve+=temp; iAchieve = 2; } if (bCity && (iCity == 1)) {
				 * if(company.length()<=8) { city+=temp; iCity = 2; }else{ bCity
				 * = false; } } } Project projectinfo = new Project(); String
				 * text = sList.get(i);
				 * projectinfo.setStartTime(getStartTime(text)); String textSen
				 * = (i + 1)>=sList.size()?"":sList.get(i + 1);
				 * projectinfo.setEndTime(getStartTime(textSen));
				 * projectinfo.setCompany(company);
				 * projectinfo.setProjectName(project_name);
				 * projectinfo.setDuty(duty); projectinfo.setAchieve(achieve);
				 * projectinfo.setContent(content); projectinfo.setCity(city);
				 * 
				 * //projectinfo.setInfo(info.trim());
				 * //projectinfo.setProjectInfo(info.trim());
				 * projectinfo.setInfo(project.trim());
				 * projectinfo.setProjectInfo(project.trim());
				 * 
				 * //System.out.println("projectinfo" + projectinfo.toString()
				 * ); //
				 */
				pList.add(projectinfo);
				projectinfo = null;
			}
			i += 2;
		} // for

		if (iList.size() <= 0) {
			String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
			project = info.substring(0, length);
			// System.out.println("project before = " + project);
			/// *
			pattern = Pattern.compile(
					"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
			matcher = pattern.matcher(project);
			int templocation = 0;
			int tempcount = 0;
			while (matcher.find()) {
				// String str = matcher.group();
				// sList.add(str);
				// iList.add(matcher.start());
				tempcount++;
				if (tempcount == 2) {
					templocation = matcher.end();
					break;
				}
			}
			project = project.substring(templocation, project.length());
			// */
			// System.out.println("project after = " + project);

			List<Integer> tempiList = new ArrayList<Integer>();
			List<String> tempsList = new ArrayList<String>();
			List<Medal> tempmList = new ArrayList<Medal>();
			pattern = Pattern.compile(
					"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
			matcher = pattern.matcher(project);
			int projectNameFlag = 0;
			while (matcher.find()) {
				String str = matcher.group();
				tempsList.add(str);
				tempiList.add(matcher.start());
				if (str.equals("项目名称") || str.equals("名称")) {
					projectNameFlag = 1;
				}
			}
			for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
				if (tempi >= templen - 1) {
					// System.out.println(project.substring(tempiList.get(tempi),
					// project.length()));
				} else {
					// System.out.println(project.substring(tempiList.get(tempi),
					// tempiList.get(tempi+1)));
				}
			}
			Project projectinfo = new Project();
			if (projectNameFlag == 0) {
				if (tempiList.size() == 0) {
					projectinfo.setInfo(project.substring(0, project.length()));
				} else {
					projectinfo.setInfo(project.substring(0, tempiList.get(0)));
				}
			}
			for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
				if (tempi >= templen - 1) {
					if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
						projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
					} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
							|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
						projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
					} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
							|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
							|| tempsList.get(tempi).equals("项目职责")) {
						projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
					}
				} else {
					if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
						projectinfo.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
					} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
							|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
						projectinfo.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
					} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
							|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
							|| tempsList.get(tempi).equals("项目职责")) {
						projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
					}
				}
			}
			pList.add(projectinfo);
			projectinfo = null;
		} // iList.size() = 2

		int flag = 1;
		if (pList.size() > 0) {
			for (Project pListOne : pList) {

				if ((pListOne.getName() == null || pListOne.getName().equals(""))
						&& (pListOne.getDuty() == null || pListOne.getDuty().equals(""))
						&& (pListOne.getContent() == null || pListOne.getContent().equals(""))
						&& (pListOne.getStartTime() == null || pListOne.getStartTime().equals(""))
						&& (pListOne.getEndTime() == null || pListOne.getEndTime().equals(""))
						&& (pListOne.getProjectInfo() == null || pListOne.getProjectInfo().equals(""))) {
					flag = 0;
					// break;
				} else {
					flag = 1;
					break;
				}
			}
		} else { // pList.size() <= 0
			flag = 0;
		}
		// System.out.println("flag project = " + flag);
		// map.setProjects(pList);
		iList = null;
		sList = null;
		pList = null;
		return flag;
	}

	/**
	 * 函数名：parsePaper() * 功 能：识别论文与著作
	 */
	private int checkPaper(String info, CVObject map) {
		Paper paperinfo = new Paper();
		paperinfo.setInfo(info.trim());
		paperinfo.setPaperInfo(info.trim());
		List<Paper> papers = new ArrayList<Paper>();
		papers.add(paperinfo);
		// map.setPapers(papers);
		// paperinfo = null;
		int flag = 0;
		// System.out.println("paperinfo = " + paperinfo.getInfo());
		// System.out.println("paper paperinfo = " + paperinfo.getPaperInfo());
		Pattern pageNumber = Pattern.compile(
				"\\d{4},\\d{1,3}\\(\\d{1,3}\\):\\d{1,4}-\\d{1,4}|pp\\.\\d{1,4}-\\d{1,4}|会议|国际会议|顶级会议|国际重要会议|期刊|顶级期刊|英文期刊|学报");
		Matcher matcher = pageNumber.matcher(info);
		while (matcher.find()) {
			// System.out.println(matcher.group());
			flag = 1;
			break;
		}
		return flag;
	}

	/**
	 * 函数名：parsePatent() * 功 能：识别专利与著作权。
	 */
	private int checkPatent(String info, CVObject map) {
		Patent patentinfo = new Patent();
		patentinfo.setInfo(info.trim());
		patentinfo.setPatentInfo(info.trim());
		// System.out.println("patentinfo" + patentinfo.toString() );
		List<Patent> patents = new ArrayList<Patent>();
		patents.add(patentinfo);
		// map.setPatents(patents);
		int flag = 0;
		// System.out.println("paperinfo = " + paperinfo.getInfo());
		// System.out.println("paper paperinfo = " + paperinfo.getPaperInfo());
		Pattern pageNumber = Pattern.compile("([A-Za-z]{0,2})\\d{12}\\.\\d{1}|([A-Za-z]{0,2})\\d{12}\\.([0-9A-Za-z]+)");
		Matcher matcher = pageNumber.matcher(info);
		while (matcher.find()) {
			// System.out.println(matcher.group());
			flag = 1;
			break;
		}
		return flag;
		// patents = null ;
		// patentinfo = null ;
	}

	/**
	 * 函数名：parseSkill() 功 能：识别技能信息块的内容
	 * 
	 * @throws IOException
	 */
	private int checkSkill(String info, CVObject map) throws IOException {
		// System.out.println("check skill = " + info);
		List<Skill> skills = new ArrayList<Skill>();
		info = info.replaceAll("||    ||||", "");
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<Medal> mList = new ArrayList<Medal>();
		// 解析IT技能
		Pattern pattern = Pattern.compile("精通|熟悉|了解|熟练|良好|一般");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());
		}
		for (int i = 0, len = iList.size(); i < len; i++) {
			if (i == len - 1) {
				// System.out.println(info.substring(iList.get(i),
				// info.length()));
				Lexeme lex = null;
				StringReader sr = new StringReader(info);// info.substring(iList.get(i),
															// info.length())
				IKSegmenter ik = new IKSegmenter(sr, true);
				StringBuilder sSkillName = new StringBuilder();
				String str = "";
				while ((lex = ik.next()) != null) {
					String tmp = "";
					tmp = lex.getLexemeText();

					Integer type = m_UserDic.get(tmp); // 测试字段类型
					if (m_UserDic.containsKey(tmp)) {
						// System.out.println("tmp == 17");
						if (m_UserDic.get(tmp) == 17 || m_UserDic.get(tmp) == 13) {
							int tmpflag = 1;
							for (Skill skillOne : skills) {
								if (skillOne.getSkillName().equals(tmp)) {
									tmpflag = 0;
									break;
								}
							}
							if (tmpflag == 1) {
								Skill skill = new Skill();
								skill.setSkillName(tmp);
								skill.setInfo(info.substring(iList.get(i), info.length()));
								skill.setSkillInfo(sList.get(i));
								skills.add(skill);
								// System.out.println("skill name = " +
								// skill.getSkillName() + " level = " +
								// skill.getSkillInfo());
							}
						}
					}
				}
			} else {
				// System.out.println(info.substring(iList.get(i),
				// iList.get(i+1)));
				Lexeme lex = null;
				StringReader sr = new StringReader(info.substring(iList.get(i), iList.get(i + 1)));
				IKSegmenter ik = new IKSegmenter(sr, true);
				StringBuilder sSkillName = new StringBuilder();
				String str = "";
				while ((lex = ik.next()) != null) {
					String tmp = "";
					tmp = lex.getLexemeText();
					// System.out.println(tmp);
					if (m_UserDic.containsKey(tmp)) {
						if (m_UserDic.get(tmp) == 17 || m_UserDic.get(tmp) == 13) {
							int tmpflag = 1;
							for (Skill skillOne : skills) {
								if (skillOne.getSkillName().equals(tmp)) {
									tmpflag = 0;
									break;
								}
							}
							if (tmpflag == 1) {
								Skill skill = new Skill();
								skill.setSkillName(tmp);
								skill.setInfo(info.substring(iList.get(i), info.length()));
								skill.setSkillInfo(sList.get(i));
								skills.add(skill);
								// System.out.println("skill name = " +
								// skill.getSkillName() + " level = " +
								// skill.getSkillInfo());
							}
						}
					}
				}
			}
		}
		if (iList.size() == 0) {
			Lexeme lex = null;
			StringReader sr = new StringReader(info);
			IKSegmenter ik = new IKSegmenter(sr, true);
			StringBuilder sSkillName = new StringBuilder();
			String str = "";
			try {
				while ((lex = ik.next()) != null) {
					String tmp = "";
					// sSkillName.delete(0, sSkillName.length());
					tmp = lex.getLexemeText();
					// System.out.println(tmp);
					if (m_UserDic.containsKey(tmp)) {
						if (m_UserDic.get(tmp) == 17 || m_UserDic.get(tmp) == 13) {
							sSkillName.append(tmp + "  ");
							// System.out.println("==");
							Skill skill = new Skill();
							skill.setSkillName(sSkillName.toString());
							skill.setInfo(info.trim());
							skill.setSkillInfo(info.trim());
							skills.add(skill);
							// map.setSkills(skills);
							skill = null;

						}
					}
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		/*
		 * //System.out.println("技能：" + info); Lexeme lex = null; StringReader
		 * sr = new StringReader(info); IKSegmenter ik = new IKSegmenter(sr,
		 * true); StringBuilder sSkillName = new StringBuilder(); String str =
		 * ""; try { while ((lex = ik.next()) != null) { String tmp = ""; tmp =
		 * lex.getLexemeText(); //System.out.println("tmp = " + tmp); if
		 * (m_UserDic.containsKey(tmp)) { //System.out.println("contains key");
		 * //System.out.println(m_UserDic.get(tmp)); if (m_UserDic.get(tmp) ==
		 * 0) { //System.out.println("key == 0"); sSkillName.append(tmp +"  ");
		 * } } } } catch (IOException e) { e.printStackTrace(); } Skill skill =
		 * new Skill(); skill.setSkillName(sSkillName.toString());
		 * skill.setInfo(info.trim()); skill.setSkillInfo(info.trim());
		 * //System.out.println("skill" + skill.toString() ); List<Skill> skills
		 * = new ArrayList<Skill>(); skills.add(skill); //
		 */

		int flag = 1;
		if (skills.size() > 0) {
			for (Skill skillsOne : skills) {
				// System.out.println("skill name = " +
				// skillsOne.getSkillName());
				if ((skillsOne.getSkillName() == null || skillsOne.getSkillName().equals(""))) {
					flag = 0;
					// break;
				} else {
					flag = 1;
					break;
				}
			}
		} else {
			// System.out.println("skill name = " + !info.contains("精通"));
			if (!info.contains("精通") && !info.contains("了解") && !info.contains("熟悉") && !info.contains("熟练"))
				flag = 0;
			else
				flag = 1;
		}
		// System.out.println("flag = " + flag);
		// map.setSkills(skills);
		// skill = null;
		skills = null;
		return flag;
	}

	/**
	 * 函数名：parseMedal() 功 能：识别获奖情况信息块的起止时间、奖励内容
	 * 
	 * @throws IOException
	 */
	private int checkMedal(String info, CVObject map) throws IOException {
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<Medal> mList = new ArrayList<Medal>();
		Pattern pattern = Pattern.compile(
				"((19\\d{2}|20\\d{2})-(19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})\\/0\\d{1})|((19\\d{2}|20\\d{2})\\/11)|((19\\d{2}|20\\d{2})\\/12)|((19\\d{2}|20\\d{2})-0\\d{1})|((19\\d{2}|20\\d{2})-11)|((19\\d{2}|20\\d{2})-12)|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.0\\d{1})|((19\\d{2}|20\\d{2})\\.11)|((19\\d{2}|20\\d{2})\\.12)|现在|至今|到现在|目前");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());
			// System.out.println("time = " + str);
		}
		int length = info.length();
		String medal = "";
		int type = 0;
		int iContent = 0;
		boolean bContent = false;
		// System.out.println("ilist size = " + iList.size());
		for (int i = 0, len = iList.size(); i < len; i++) {
			if (iList.size() > 0) {
				if (i == 0) {
					medal = info.substring(iList.get(0), len == 1 ? length : iList.get(1)).replaceAll(sList.get(0), "");
					Medal medalinfo = new Medal();
					String text = sList.get(i);
					medalinfo.setGetTime(getStartTimeMedal(text));
					medalinfo.setInfo(medal);
					medalinfo.setMedalInfo(info.trim());
					// System.out.println("medalinfo" + medalinfo.toString() );
					mList.add(medalinfo);
					medalinfo = null;
				} else if (i <= len - 2) {
					medal = info.substring(iList.get(i), iList.get(i + 1)).replaceAll(sList.get(i), "");
					Medal medalinfo = new Medal();
					String text = sList.get(i);
					medalinfo.setGetTime(getStartTimeMedal(text));
					medalinfo.setInfo(medal);
					medalinfo.setMedalInfo(info.trim());
					// System.out.println("medalinfo" + medalinfo.toString() );
					mList.add(medalinfo);
					medalinfo = null;
				} else {
					medal = info.substring(iList.get(i), length).replaceAll(sList.get(i), "");
					Medal medalinfo = new Medal();
					String text = sList.get(i);
					medalinfo.setGetTime(getStartTimeMedal(text));
					medalinfo.setInfo(medal);
					medalinfo.setMedalInfo(info.trim());
					// System.out.println("medalinfo" + medalinfo.toString() );
					mList.add(medalinfo);
					medalinfo = null;
				}
			} else {
				medal = info;
				Medal medalinfo = new Medal();
				medalinfo.setInfo(medal.trim());
				medalinfo.setMedalInfo(info.trim());
				// System.out.println("medalinfo" + medalinfo.toString() );
				mList.add(medalinfo);
				medalinfo = null;
			}
		}
		// System.out.println("sList size = " + sList.size());
		if (sList.size() == 0) {
			// System.out.println("sList size == 0");
			Medal medalinfo = new Medal();
			medalinfo.setInfo(medal);
			medalinfo.setMedalInfo(info.trim());
			// System.out.println("medalinfo" + medalinfo.getMedalInfo() );
			mList.add(medalinfo);
			medalinfo = null;
		}

		int flag = 1;
		if (mList.size() > 0) {
			for (Medal mListOne : mList) {
				if ((mListOne.getMedalName() == null || mListOne.getMedalName().equals(""))
						&& (mListOne.getMedalInfo() == null || mListOne.getMedalInfo().equals(""))) {
					flag = 0;
					// break;
				} else {
					flag = 1;
					break;
				}
			}
		} else {
			flag = 0;
		}
		// map.setMedals(mList);
		iList = null;
		sList = null;
		mList = null;
		// System.out.println("flag = " + flag);
		return flag;
	}

	/**
	 * 函数名：parseComment() * 功 能：识别自我评价信息块的内容
	 */
	private int checkComment(String info, CVObject map) {
		// System.out.println("info = " + info);
		Lexeme lex = null;
		StringReader sr = new StringReader(info);
		IKSegmenter ik = new IKSegmenter(sr, true);
		String str = "";
		try {
			while ((lex = ik.next()) != null) {
				String tmp = "";
				tmp = lex.getLexemeText();
				if (m_UserDic.containsKey(tmp)) {
					if (m_UserDic.get(tmp) == 108)
						str = tmp;
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		Comment comment = new Comment();
		comment.setInfo(info.trim());
		comment.setCommentInfo(info.trim());
		List<Comment> comments = new ArrayList<Comment>();
		comments.add(comment);
		int flag = 0;
		Pattern pageNumber = Pattern.compile(
				"新人|新鲜感|挑战|本人|综合素质|吃苦耐劳|谦虚|兴趣广泛|毅力强|做事果断|认真负责|出身|已有10年|4年以上javaweb开发经验|近一年半|较深的理解|自由奔放|多才多艺|活泼热情|接受挑战|拥有|积极主动|坦诚待人|乐于互助|乐于沟通|熟练|精通|踏实|谨慎踏实|幽默|执行力|热爱|熟悉|勤勉|踏实|责任心|上进心|有责任心|有上进心|积极向上|吃苦耐劳|诚恳稳重|沟通能力|执行能力|追求卓越|视野开阔|创新能力强|勇于挑战|能力强|善于沟通|善于合作|性格|执着|兴趣爱好广泛|适应能力强|乐观向上|熟练掌握|深入理解|学习能力|团队协作能力|熟悉|理解|细心|耐心");
		Matcher matcher = pageNumber.matcher(info);
		// System.out.println(info);
		// System.out.println(matcher.find());
		while (matcher.find()) {
			// System.out.println(matcher.group());
			flag = 1;
			break;
		}
		// map.setComments(comments);
		comment = null;
		comments = null;
		// System.out.println("flag = " + flag);
		return flag;
	}

	/**
	 * 函数名：parseExpectationl() 功 能：识别求职期望信息块的内容
	 */
	private int checkExpectation(String info, CVObject map) throws IOException {
		Lexeme lex = null;
		StringReader sr = new StringReader(info);
		IKSegmenter ik = new IKSegmenter(sr, true);
		StringBuilder str = new StringBuilder();
		int count = 0;
		while ((lex = ik.next()) != null) {
			count--;
			String tmp = "";
			tmp = lex.getLexemeText();
			if (m_UserDic.containsKey(tmp)) {
				if (m_UserDic.get(tmp) == 109) {
					count = 2;
				}
			}
			if (count == 1) {
				str.append(tmp);
				count = 2;
			}
		}
		Expectation expectationinfo = new Expectation();
		// expectationinfo.setInfo(str.toString().trim());
		expectationinfo.setExpectationInfo(str.toString().trim());
		// System.out.println("expectationinfo" + expectationinfo.toString() );
		// map.setExpectation(expectationinfo);
		int flag = 0;
		// System.out.println("paperinfo = " + paperinfo.getInfo());
		// System.out.println("paper paperinfo = " + paperinfo.getPaperInfo());
		if ((expectationinfo.getExpectationInfo() == null || expectationinfo.getExpectationInfo().equals(""))) {
			flag = 0;
			// break;
		} else {
			flag = 1;
			// break;
		}
		return flag;
		// str = null;
		// expectationinfo = null;
	}

	/**
	 * 合并模块：相应的块儿交给相应的方法
	 * 
	 * @param text
	 *            处理后的文本（去空格、全角转半角...）
	 * @param indexs
	 *            索引文本矩阵
	 * @throws IOException
	 *             ...
	 */
	private void combineBlocks(String text, int[][] indexs) throws IOException {
		CVObject map = null;
		for (int i = 0; i < indexs[0].length - 1; i++) {
			String strType = "";

			if (i == 99) {
				strType = text.substring(indexs[0][i], text.length());
			} else {
				strType = text.substring(indexs[0][i], indexs[0][i + 1]);
			}
			switch (indexs[1][i]) {
			case 100:
				int tempBasic = checkBasic(strType, map);
				if (tempBasic == 0) {
					indexs[0][i] = text.length();
					indexs[1][i] = 0;
				}
				break;
			case 101:
				int tempEducation = checkEducation(strType, map);
				if (tempEducation == 0) {
					indexs[0][i] = text.length();
					indexs[1][i] = 0;
				}
				break;
			case 102:
				int tempJob = checkJob(strType, map);
				if (tempJob == 0) {
					indexs[0][i] = text.length();
					indexs[1][i] = 0;
				}
				break;
			case 103:
				int tempProject = checkProject(strType, map);
				if (tempProject == 0) {
					indexs[0][i] = text.length();
					indexs[1][i] = 0;
				}
				break;
			case 104:
				int tempMedal = checkMedal(strType, map);
				if (tempMedal == 0) {
					indexs[0][i] = text.length();
					indexs[1][i] = 0;
				}
				break;
			case 105:
				int tempSkill = checkSkill(strType, map);
				if (tempSkill == 0) {
					indexs[0][i] = text.length();
					indexs[1][i] = 0;
				}
				break;
			case 106:
				int tempPaper = checkPaper(strType, map);
				if (tempPaper == 0) {
					indexs[0][i] = text.length();
					indexs[1][i] = 0;
				}
				break;
			case 107:
				int tempPatent = checkPatent(strType, map);
				if (tempPatent == 0) {
					indexs[0][i] = text.length();
					indexs[1][i] = 0;
				}
				break;
			case 108:
				int tempComment = checkComment(strType, map);
				if (tempComment == 0) {
					indexs[0][i] = text.length();
					indexs[1][i] = 0;
				}
				break;
			case 109:
				int tempExpectation = checkExpectation(strType, map);
				if (tempExpectation == 0) {
					indexs[0][i] = text.length();
					indexs[1][i] = 0;
				}
				break;
			case 110:
				// parseOther(strType,map);
				break;
			default:
				break;
			}
		}
	}

	@Test
	public void testName() {
		String name = "赵   云   云";
		String[] xings = name.split("\\s+");

		for (int i = 0; i < 3; i++) {
			if (name.substring(0, 1).equals(xings[i])) {
				String word = name;
				boolean flag = false;
				if (word.length() >= 2 && word.substring(0, 2).equals(xings[i]) && word.length() <= 4) {
					flag = true;
				}
				if (word.length() >= 1 && word.substring(0, 1).equals(xings[i]) && word.length() <= 4) {
					flag = true;
				}

				System.out.println(flag);
			}
			;
		}

	}

	/**
	 * 位置优先识别 ，取出姓名
	 */
	private String detectName1(String content) { // \n

		String name = null;
		if (content != null) {

			/* 百家姓字典数组 */
			String[] xings = null;
			InputStream in = null ; 
			try {
				// 加载词典
			    in = Constants.class.getResourceAsStream(Constants.baijiaxing); 
				String tempStr = "";
				BufferedReader read = new BufferedReader(new InputStreamReader(in, "utf-8"));
				
				
				int count = 0;
				while ((tempStr = read.readLine()) != null) {
					xings = tempStr.split("\\s+");
				}
			} catch (IOException e) {
				e.printStackTrace();
			} finally {
				try {
					if (in != null) {
						in.close();
						in = null;
					}
				} catch (Exception e2) {
					e2.printStackTrace();
				}
			}

			// 替换所有空格
			content = content.replace(" ", "");
			// 按行切分
			for (String line : content.split("(\r{0,1}\n)|(\r)")) {
				// 按符号切分
				line = transferCharacterToSpace(line);
				int num = 0;
				if (line != null)
					for (String word : line.split("\\s+")) {
						if (num == 0) {
							for (int i = 0; i < xings.length; i++) {
								boolean flag = false;
								if (word.length() >= 2 && word.substring(0, 2).equals(xings[i]) && word.length() <= 4) {
									flag = true;
								}

								if (word.length() >= 1 && word.substring(0, 1).equals(xings[i]) && word.length() <= 3) {
									flag = true;
								}
								// 写入map
								if (flag) {
									if(!checkName2(word)){
										name = word;
										return name;
									} 
								}

							}

						}
						num++;
					}

			}

		}
		return name;
	}

	@Test
	public void test() {
		String str = "dasdsadas\r\nasdsada\ndasda\rdsa";
		for (String ss : str.split("(\r{0,1}\n)|(\r)")) {
			System.out.println(ss);
		}

	}

	/**
	 * 识别姓名,最差的粗略识别 zzh
	 * 
	 */
	private void detectName(String content, CVObject map) {
		// p1 = re.compile(r'\s*');
		// p2 = re.compile(r':|;|.|,|');
		// System.out.println(content);
		// String[] contents = content.split("\r|\n| | | |\\s+");
		String[] contents = content.split("\\s|||    ||||\\(|\\)|·");
		// String[] contents =
		// content.split("\\s|||    ||||\\(|\\)|、|，|。|；|？|！|,|:|;|\\?|!|]|·||（|）|\\d");
		String[] xings;

		InputStream in = null;
		String[] str = null;
		try {
			in = Constants.class.getResourceAsStream(Constants.baijiaxing);
			String tempStr = "";
			BufferedReader read = new BufferedReader(new InputStreamReader(in, "UTF-8"));
//			InputStream in = File.class.getResourceAsStream(Constants.baijiaxing);
//			String tempStr = "";
//			BufferedReader read = new BufferedReader(new InputStreamReader(in));  
			int count = 0;
			while ((tempStr = read.readLine()) != null) {
				str = tempStr.split("\\s+");
			}
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				if (in != null) {
					in.close();
					in = null;
				}
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
		for (String contentOne : contents) {
			contentOne = contentOne.replaceAll("\\s|||    ||||| ", "");

			for (int i = 0; i < str.length; i++) {

				if (contentOne.length() > 1) {

					if ((map.getBasic().getName() == null || map.getBasic().getName().equals(""))
							&& contentOne.length() >= 2 && (contentOne.substring(0, 1).contains(str[i])
									|| contentOne.substring(0, 2).equals(str[i]))
							&& contentOne.length() <= 4) {
						map.getBasic().setName(contentOne);

						if (contentOne.equals("赵宸贝妮")) {
							// System.out.println("find");
							// System.out.println((map.getBasic().getName() ==
							// null || map.getBasic().getName().equals("")) &&
							// contentOne.length() >= 2 &&
							// (contentOne.substring(0, 1).contains(str[i]) ||
							// contentOne.substring(0, 2).contains(str[i])) &&
							// contentOne.length()<=5);
						}
						// */
					}
				}
			}
		}
	}

	// 标点符号转空格
	private String transferCharacterToSpace(String content) {
		// TODO Auto-generated method stub

		content = content.replace("-", " ");
		content = content.replace(":", " ");
		// content = content.replace( "."," ");
		content = content.replace(",", " ");
		content = content.replace("/", " ");
		content = content.replace("%", " ");
		content = content.replace("#", " ");
		content = content.replace("!", " ");
		// content = content.replace("＠", "@");
		content = content.replace("&", " ");
		content = content.replace("(", " ");
		content = content.replace(")", " ");
		content = content.replace("<", " ");
		content = content.replace(">", " ");
		content = content.replace("\"", " ");
		// content = content.replace("＇", "'");
		content = content.replace("?", " ");
		content = content.replace("[", " ");
		content = content.replace("]", " ");
		content = content.replace("{", " ");
		content = content.replace("}", " ");
		content = content.replace("\\\\", " ");
		content = content.replace("|", " ");
		content = content.replace("+", " ");
		content = content.replace("=", " ");
		content = content.replace("_", " ");
		content = content.replace("^", " ");
		content = content.replace("$", " ");
		content = content.replace("~", " ");
		content = content.replace("`", " ");

		return content;

	}

	// 全角转半角
	public String transferCharacter(String content) {
		// String former = "２＼２";
		// System.out.println("former = " + former);
		// String latter = former.replaceAll("＼", "\\\\");
		// System.out.println("latter = " + latter);

		content = content.replaceAll("０", "0");
		content = content.replaceAll("１", "1");
		content = content.replaceAll("２", "2");
		content = content.replaceAll("３", "3");
		content = content.replaceAll("４", "4");
		content = content.replaceAll("５", "5");
		content = content.replaceAll("６", "6");
		content = content.replaceAll("７", "7");
		content = content.replaceAll("８", "8");
		content = content.replaceAll("９", "9");

		content = content.replaceAll("Ａ", "A");
		content = content.replaceAll("Ｂ", "B");
		content = content.replaceAll("Ｃ", "C");
		content = content.replaceAll("Ｄ", "D");
		content = content.replaceAll("Ｅ", "E");
		content = content.replaceAll("Ｆ", "F");
		content = content.replaceAll("Ｇ", "G");
		content = content.replaceAll("Ｈ", "H");
		content = content.replaceAll("Ｉ", "I");
		content = content.replaceAll("Ｊ", "J");
		content = content.replaceAll("Ｋ", "K");
		content = content.replaceAll("Ｌ", "L");
		content = content.replaceAll("Ｍ", "M");
		content = content.replaceAll("Ｎ", "N");
		content = content.replaceAll("Ｏ", "O");
		content = content.replaceAll("Ｐ", "P");
		content = content.replaceAll("Ｑ", "Q");
		content = content.replaceAll("Ｒ", "R");
		content = content.replaceAll("Ｓ", "S");
		content = content.replaceAll("Ｔ", "T");
		content = content.replaceAll("Ｕ", "U");
		content = content.replaceAll("Ｖ", "V");
		content = content.replaceAll("Ｗ", "W");
		content = content.replaceAll("Ｘ", "X");
		content = content.replaceAll("Ｙ", "Y");
		content = content.replaceAll("Ｚ", "Z");

		content = content.replaceAll("ａ", "a");
		content = content.replaceAll("ｂ", "b");
		content = content.replaceAll("ｃ", "c");
		content = content.replaceAll("ｄ", "d");
		content = content.replaceAll("ｅ", "e");
		content = content.replaceAll("ｆ", "f");
		content = content.replaceAll("ｇ", "g");
		content = content.replaceAll("ｈ", "h");
		content = content.replaceAll("ｉ", "i");
		content = content.replaceAll("ｊ", "j");
		content = content.replaceAll("ｋ", "k");
		content = content.replaceAll("ｌ", "l");
		content = content.replaceAll("ｍ", "m");
		content = content.replaceAll("ｎ", "n");
		content = content.replaceAll("ｏ", "o");
		content = content.replaceAll("ｐ", "p");
		content = content.replaceAll("ｑ", "q");
		content = content.replaceAll("ｒ", "r");
		content = content.replaceAll("ｓ", "s");
		content = content.replaceAll("ｔ", "t");
		content = content.replaceAll("ｕ", "u");
		content = content.replaceAll("ｖ", "v");
		content = content.replaceAll("ｗ", "w");
		content = content.replaceAll("ｘ", "x");
		content = content.replaceAll("ｙ", "y");
		content = content.replaceAll("ｚ", "z");

		content = content.replaceAll("－", "-");
		content = content.replaceAll("　", " ");
		content = content.replaceAll("：", ":");
		content = content.replaceAll("．", ".");
		content = content.replaceAll("，", ",");
		content = content.replaceAll("／", "/");
		content = content.replaceAll("％", "%");
		content = content.replaceAll("＃", "#");
		content = content.replaceAll("！", "!");
		content = content.replaceAll("＠", "@");
		content = content.replaceAll("＆", "&");
		content = content.replaceAll("（", "(");
		content = content.replaceAll("）", ")");
		content = content.replaceAll("＜", "<");
		content = content.replaceAll("＞", ">");
		content = content.replaceAll("＂", "\"");
		content = content.replaceAll("＇", "'");
		content = content.replaceAll("？", "?");
		content = content.replaceAll("［", "[");
		content = content.replaceAll("］", "]");
		content = content.replaceAll("｛", "{");
		content = content.replaceAll("｝", "}");
		content = content.replaceAll("＼", "\\\\");
		content = content.replaceAll("｜", "|");
		content = content.replaceAll("＋", "+");
		content = content.replaceAll("＝", "=");
		content = content.replaceAll("＿", "_");
		content = content.replaceAll("＾", "^");
//		content = content.replaceAll("￥", "$");
		content = content.replaceAll("￣", "~");
		content = content.replaceAll("｀", "`");

		return content;
	}

	/**
	 * 对简历进行分块 简历共分为11个信息域： Basic :个人信息 Education :教育背景 Job :工作经历 Project :项目经验
	 * Paper :校内奖励 Patent :专业技能 Medal :学术论文 Expectation :主要专利 Comment :自我评价
	 * Skill :求职意向 Other :其他信息
	 * 
	 */
	public int getSeparation(String content, CVObject map) throws IOException {

		 //存储原始文本
		map.setCvInfo(content);
		// 简历基本表
		// 若干个分块索引
		int iBasic, iEducation, iJob, iProject, iPaper, iPatent, iMedal, iExpectation, iComment, iSkill, iOther;
		iBasic = iEducation = iJob = iProject = iPaper = iPatent = iMedal = iExpectation = iComment = iSkill = iOther = 0;
		// String text = content.replaceAll(" ", "");// 消除空格
		String text = content.replaceAll("\\s+", "");
		text = text.replace("", " ");  
		text = transferCharacter(text);// 全角转半角

		// Ik分词
		StringReader sr = new StringReader(text);
		IKSegmenter ik = new IKSegmenter(sr, true);
		Lexeme lex = null;
		int[][] indexs = new int[2][100];// 存储11模块首个字符索引位置
		for (int i = 0; i < 100; i++) {
			indexs[0][i] = text.length();
		}
		indexs[0][0] = 0;
		indexs[1][0] = 100;
		// int size = text.length();
		int ii = 0;
		int c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = 0, c6 = 0, c7 = 0, c8 = 0, c9 = 0, c10 = 0, c11 = 0;
		String str = "";
		while ((lex = ik.next()) != null) {
			// System.out.println(lex);
			if (m_UserDic.containsKey(lex.getLexemeText())) {
				int type = m_UserDic.get(lex.getLexemeText());
				switch (type) {
				case 100:
					iBasic = lex.getBeginPosition();
					indexs[0][ii] = iBasic;
					indexs[1][ii] = 100;
					ii++;
					break;
				case 101:
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iEducation = lex.getBeginPosition();
					indexs[0][ii] = iEducation;
					indexs[1][ii] = 101;
					ii++;
					break;
				case 102:
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iJob = lex.getBeginPosition();
					indexs[0][ii] = iJob;
					indexs[1][ii] = 102;
					ii++;
					break;
				case 103:
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iProject = lex.getBeginPosition();
					indexs[0][ii] = iProject;
					indexs[1][ii] = 103;
					ii++;
					break;
				case 104:
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iPaper = lex.getBeginPosition();
					indexs[0][ii] = iPaper;
					indexs[1][ii] = 104;
					ii++;
					break;
				case 105:
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iPatent = lex.getBeginPosition();
					indexs[0][ii] = iPatent;
					indexs[1][ii] = 105;
					ii++;
					break;
				case 106:
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iMedal = lex.getBeginPosition();
					indexs[0][ii] = iMedal;
					indexs[1][ii] = 106;
					ii++;
					break;
				case 107:
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iExpectation = lex.getBeginPosition();
					indexs[0][ii] = iExpectation;
					indexs[1][ii] = 107;
					ii++;
					break;
				case 108:
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iComment = lex.getBeginPosition();
					indexs[0][ii] = iComment;
					indexs[1][ii] = 108;
					ii++;
					break;
				case 109:
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iSkill = lex.getBeginPosition();
					indexs[0][ii] = iSkill;
					indexs[1][ii] = 109;
					ii++;
					break;
				case 110:
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iOther = lex.getBeginPosition();
					indexs[0][ii] = iOther;
					indexs[1][ii] = 110;
					ii++;
					break;
				default:
					break;
				}
			}
		}
		if (indexs[0][0] == text.length()) {
			iBasic = 0;
			indexs[0][0] = iBasic;
			indexs[1][0] = 100;
		}
		// */

		// 对分块进行排序
		insertsort(indexs);
		combineBlocks(text, indexs);
		insertsort(indexs);

		// 合并间隔块儿
		for (int tempii = 0; tempii < 99; tempii++) {
			if (indexs[1][tempii] != 0) {
				for (int tempjj = tempii + 1; tempjj < 100; tempjj++) {
					if (indexs[1][tempjj] != 0) {
						if (indexs[1][tempii] == indexs[1][tempjj]) {
							indexs[0][tempjj] = text.length();
							indexs[1][tempjj] = 0;
							// break;
						} else {
							break;
						}
					}
				}
			}
		}
		// */
		insertsort(indexs);

		int[][] indexType = new int[2][11];// 存储11模块首个字符索引位置
		for (int i = 0; i < 11; i++) {
			indexType[0][i] = 0;
			indexType[1][i] = i;

		}
		// 查看哪些模块有值
		for (int i = 0; i < 100; i++) {
			switch (indexs[1][i]) {
			case 100:
				indexType[0][0] = 1;
				break;
			case 101:
				indexType[0][1] = 1;
				break;
			case 102:
				indexType[0][2] = 1;
				break;
			case 103:
				indexType[0][3] = 1;
				break;
			case 104:
				indexType[0][4] = 1;
				break;
			case 105:
				indexType[0][5] = 1;
				break;
			case 106:
				indexType[0][6] = 1;
				break;
			case 107:
				indexType[0][7] = 1;
				break;
			case 108:
				indexType[0][8] = 1;
				break;
			case 109:
				indexType[0][9] = 1;
				break;
			case 110:
				indexType[0][10] = 1;
				break;
			default:
				break;
			}
		}

		String strType = "";

		Pattern pGender = Pattern.compile("男|女");
		Pattern pAge = Pattern.compile("\\d{2}岁");
		Pattern pPhone = Pattern
				.compile("14\\d{9}|17\\d{9}|13\\d{9}|15\\d{9}|18\\d{9}|\\d{3,4}-\\d{4}-\\d{4}|\\d{3,4}-\\d{6,8}");
		Pattern pEmail = Pattern.compile("([0-9A-Za-z\\-_\\.]+)@([0-9A-Za-z]+\\.[A-Za-z]{2,3}(\\.[A-Za-z]{2})?)");
		Pattern pJobtime = Pattern.compile("\\d年工作经验|\\d年经验|\\d年以上工作经验|\\d年以上经验");
		Pattern pDegreeBen = Pattern.compile("本科|学士");
		Pattern pDegreeShuo = Pattern.compile("硕士|研究生");
		Pattern pDegreeBo = Pattern.compile("博士");
		Matcher matcherBen = pDegreeBen.matcher(content);
		while (matcherBen.find()) {
			degree = matcherBen.group();
			break;
		}
		Matcher matcherShuo = pDegreeShuo.matcher(content);
		while (matcherShuo.find()) {
			degree = matcherShuo.group();
			break;
		}
		Matcher matcherBo = pDegreeBo.matcher(content);
		while (matcherBo.find()) {
			degree = matcherBo.group();
			break;
		}
		Matcher matcher = pGender.matcher(content);
		while (matcher.find()) {
			gender = matcher.group();
			break;
		}
		matcher = pAge.matcher(content);
		while (matcher.find()) {
			age = matcher.group();
			break;
		}
		matcher = pEmail.matcher(content);
		while (matcher.find()) {
			email = matcher.group();
			break;
		}
		matcher = pPhone.matcher(content);
		while (matcher.find()) {
			phone = matcher.group();
			break;
		}
		matcher = pJobtime.matcher(content);
		while (matcher.find()) {
			jobtime = matcher.group();
			break;
		}

		// 开始解析
		for (int i = 0, len = 100; i < len; i++) {
			String tempstr = "";
			// if (i == 10)
			if (i == 99) {
				strType = text.substring(indexs[0][i], text.length());
				tempstr = text.substring(0, text.length());
			} else {
				strType = text.substring(indexs[0][i], indexs[0][i + 1]);
				tempstr = text.substring(0, indexs[0][i + 1]);
			}
			switch (indexs[1][i]) {
			case 100:
				/// *
				System.out.println("");
				System.out.println("Basic: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// */
				parseBasic(strType, map, indexType, 1);
				
				if (map.getBasic().getName() == null || map.getBasic().getName().equals("")) {
					detectName(strType, map); // 识别姓名
				}
				if (map.getBasic().getName() == null || map.getBasic().getName().equals("")) {
					map.getBasic().setName("人才");
				} 
				
				break;
			case 101:
				/// *
				System.out.println("");
				System.out.println("Education: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// */
				// System.out.println("");
				parseEducation(strType, map, indexType, 1);
				break;
			case 102:
				/// *
				System.out.println("");
				System.out.println("Job: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// */
				// System.out.println("");
				parseJob(strType, map, indexType, 1);
				break;
			case 103:
				/// *
				System.out.println("");
				System.out.println("Project: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// */
				// parseProject(strType, map, indexType, 1);
				parseProject2(strType, map, indexType, 1);
				break;
			case 104:
				/// *
				System.out.println("");
				System.out.println("Medal: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// */
				// System.out.println("");
				parseMedal(strType, map, indexType, 1);
				break;
			case 105:
				/// *
				System.out.println("");
				System.out.println("Skill: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// */
				// System.out.println("");
				parseSkill(strType, map, indexType, 1);
				break;
			case 106:
				/// *
				System.out.println("");
				System.out.println("Paper: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// */
				// System.out.println("");
				parsePaper(strType, map, indexType, 1);
				break;
			case 107:
				/// *
				System.out.println("");
				System.out.println("Patent: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// */
				// System.out.println("");
				parsePatent(strType, map, indexType, 1);
				break;
			case 108:
				/// *
				System.out.println("");
				System.out.println("Comment: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// */
				// System.out.println("");
				parseComment(strType, map, indexType, 1);
				break;
			case 109:
				/// *
				System.out.println("");
				System.out.println("Expectation: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// */
				// System.out.println("");
				parseExpectation(strType, map, indexType, 1);
				break;
			case 110:
				/// *
				System.out.println("");
				System.out.println("Other: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// */
				// System.out.println("");
				parseOther(strType, map, indexType, 1);
				break;
			default:
				break;
			}
		}

		// System.out.println("basic school = " + map.getBasic().getSchool());
		if (map.getBasic() == null) {
			// System.out.println("basic == null");
			if (content.length() > 200) {
				parseGen(content.substring(0, 200), map);
			} else {
				parseGen(content.substring(0, content.length()), map);
			}

		}

		// 补全公司职位状态
		if (map.getBasic() != null) {
			if (map.getBasic().getCompany() == null || map.getBasic().getCompany().equals("")) {
				int maxEndTime = 0;
				String tempCompany = null;
				// String tempTitle = null;
				if (map.getJobs() != null) {
					for (Job jobOne : map.getJobs()) {
						String tempEndTime = jobOne.getEndTime();
						tempEndTime = tempEndTime.trim();
						tempEndTime = tempEndTime.replaceAll("[\\pP\\p{Punct}]", "");
						if (Integer.parseInt(tempEndTime) == 101) {
							// System.out.println(Integer.parseInt(tempEndTime));
							tempCompany = jobOne.getCompany();
							// tempTitle = jobOne.getTitle();
							break;
						} else {
							if (Integer.parseInt(tempEndTime) > maxEndTime) {
								// System.out.println(Integer.parseInt(tempEndTime));
								maxEndTime = Integer.parseInt(tempEndTime);
								tempCompany = jobOne.getCompany();
								// tempTitle = jobOne.getTitle();
							}
						}

					}
					map.getBasic().setCompany(tempCompany);
					if (map.getBasic().getCompany().length() > 50) {
						map.getBasic().setCompany(map.getBasic().getCompany().substring(0, 49));
					}
				}
			}
			if (map.getBasic().getTitle() == null || map.getBasic().getTitle().equals("")) {
				int maxEndTime = 0;
				// String tempCompany = null;
				String tempTitle = null;
				if (map.getJobs() != null) {
					for (Job jobOne : map.getJobs()) {
						String tempEndTime = jobOne.getEndTime();
						tempEndTime = tempEndTime.trim();
						tempEndTime = tempEndTime.replaceAll("[\\pP\\p{Punct}]", "");
						if (Integer.parseInt(tempEndTime) == 101) {
							// System.out.println(Integer.parseInt(tempEndTime));
							// tempCompany = jobOne.getCompany();
							tempTitle = jobOne.getTitle();
							break;
						} else {
							if (Integer.parseInt(tempEndTime) > maxEndTime) {
								// System.out.println(Integer.parseInt(tempEndTime));
								maxEndTime = Integer.parseInt(tempEndTime);
								// tempCompany = jobOne.getCompany();
								tempTitle = jobOne.getTitle();
							}
						}

					}
					map.getBasic().setTitle(tempTitle);
					if (map.getBasic().getTitle().length() > 12) {
						map.getBasic().setTitle(map.getBasic().getTitle().substring(0, 11));
					}
				}
			}
		}

		// 补充期望职位期望城市期望薪资
		if (map.getBasic() != null) {
			if (map.getBasic().getExpectedJob() == null || map.getBasic().getExpectedJob().equals("")) {
				if (map.getExpectation() != null) {
					lex = null;
					String temp = "";
					sr = new StringReader(map.getExpectation().getExpectationInfo());
					ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (m_UserDic.containsKey(temp)) {
							int type = m_UserDic.get(temp);
							switch (type) {
							case 14:
								map.getBasic().setExpectedJob(temp);
								break;
							default:
								break;
							}
						}
						if (map.getBasic().getExpectedJob() == null || map.getBasic().getExpectedJob().equals("")) {
						} else {
							break;
						}
					}
				}
			}
			if (map.getBasic().getExpectedCity() == null || map.getBasic().getExpectedCity().equals("")) {
				if (map.getExpectation() != null) {
					lex = null;
					String temp = "";
					sr = new StringReader(map.getExpectation().getExpectationInfo());
					ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						temp = lex.getLexemeText();
						if (m_UserDic.containsKey(temp)) {
							int type = m_UserDic.get(temp);
							switch (type) {
							case 16:
								map.getBasic().setExpectedCity(temp);
								break;
							default:
								break;
							}
						}
						if (map.getBasic().getExpectedCity() == null || map.getBasic().getExpectedCity().equals("")) {
						} else {
							break;
						}
					}
				}
			}
			if (map.getBasic().getExpectedSalary().getId() == 67) {
				int yearOrmonth = 1;
				int maxSalary = 0;
				if (map.getExpectation() != null) {
					lex = null;
					String temp = "";
					sr = new StringReader(map.getExpectation().getExpectationInfo());
					ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (temp.equals("期望月薪") || temp.equals("月薪") || temp.equals("元/月") || temp.equals("元每月")
								|| temp.equals("每月")) {
							yearOrmonth = 1;
							break;
						} else if (temp.equals("期望年薪") || temp.equals("年薪") || temp.equals("元/年") || temp.equals("元每年")
								|| temp.equals("每年") || temp.equals("年")) {
							yearOrmonth = 2;
							break;
						}
					}
					if (yearOrmonth == 1) {
						// month
						Pattern pattern1 = Pattern.compile("\\d{4,6}");
						Matcher matcher1 = pattern1.matcher(map.getExpectation().getExpectationInfo());
						while (matcher1.find()) {
							if (Integer.parseInt(matcher1.group()) > maxSalary) {
								maxSalary = Integer.parseInt(matcher1.group());
							}
						}
						if (maxSalary == 0) {
							lex = null;
							temp = "";
							sr = new StringReader(map.getExpectation().getExpectationInfo());
							ik = new IKSegmenter(sr, true);
							while ((lex = ik.next()) != null) {
								temp = lex.getLexemeText();
								if (temp.contains("万") || temp.contains("w") || temp.contains("W")) {
									pattern1 = Pattern.compile("\\d{1,3}");
									matcher1 = pattern1.matcher(temp);
									while (matcher1.find()) {
										if (Integer.parseInt(matcher1.group()) * 10000 > maxSalary) {
											maxSalary = Integer.parseInt(matcher1.group()) * 10000;
										}
									}
								}
							}
						}
						if (maxSalary == 0) {
							lex = null;
							temp = "";
							sr = new StringReader(map.getExpectation().getExpectationInfo());
							ik = new IKSegmenter(sr, true);
							while ((lex = ik.next()) != null) {
								temp = lex.getLexemeText();
								if (temp.contains("k")) {
									pattern1 = Pattern.compile("\\d{1,3}");
									matcher1 = pattern1.matcher(temp);
									while (matcher1.find()) {
										if (Integer.parseInt(matcher1.group()) * 1000 > maxSalary) {
											maxSalary = Integer.parseInt(matcher1.group()) * 1000;
										}
									}
								}
							}
						}
						maxSalary = maxSalary * 12;
					} else if (yearOrmonth == 2) {
						// year
						Pattern pattern1 = Pattern.compile("\\d{4,7}");
						Matcher matcher1 = pattern1.matcher(map.getExpectation().getExpectationInfo());
						while (matcher1.find()) {
							if (Integer.parseInt(matcher1.group()) > maxSalary) {
								maxSalary = Integer.parseInt(matcher1.group());
							}
						}
						if (maxSalary == 0) {
							lex = null;
							temp = "";
							sr = new StringReader(map.getExpectation().getExpectationInfo());
							ik = new IKSegmenter(sr, true);
							while ((lex = ik.next()) != null) {
								temp = lex.getLexemeText();
								if (temp.contains("万") || temp.contains("w") || temp.contains("W")) {
									pattern1 = Pattern.compile("\\d{1,3}");
									matcher1 = pattern1.matcher(temp);
									while (matcher1.find()) {
										if (Integer.parseInt(matcher1.group()) * 10000 > maxSalary) {
											maxSalary = Integer.parseInt(matcher1.group()) * 10000;
										}
									}
								}
							}
						}
						if (maxSalary == 0) {
							lex = null;
							temp = "";
							sr = new StringReader(map.getExpectation().getExpectationInfo());
							ik = new IKSegmenter(sr, true);
							while ((lex = ik.next()) != null) {
								temp = lex.getLexemeText();
								if (temp.contains("k")) {
									pattern1 = Pattern.compile("\\d{1,3}");
									matcher1 = pattern1.matcher(temp);
									while (matcher1.find()) {
										if (Integer.parseInt(matcher1.group()) * 1000 > maxSalary) {
											maxSalary = Integer.parseInt(matcher1.group()) * 1000;
										}
									}
								}
							}
						}
					}
				}
				/*
				 * if(yearOrmonth == 1) { //month Pattern pattern1 =
				 * Pattern.compile("\\d{4,6}"); Matcher matcher1 =
				 * pattern1.matcher(map.getExpectation().getInfo()); while
				 * (matcher1.find()) { if(Integer.parseInt(matcher1.group()) >
				 * maxSalary) { maxSalary = Integer.parseInt(matcher1.group());
				 * } } if(maxSalary == 0) { lex = null; String temp = ""; sr =
				 * new StringReader(map.getExpectation().getInfo()); ik = new
				 * IKSegmenter(sr, true); while ((lex = ik.next()) != null) {
				 * temp = lex.getLexemeText(); if (temp.contains("万")) {
				 * pattern1 = Pattern.compile("\\d{1,3}"); matcher1 =
				 * pattern1.matcher(temp); while (matcher1.find()) {
				 * if(Integer.parseInt(matcher1.group())*10000 > maxSalary) {
				 * maxSalary = Integer.parseInt(matcher1.group())*10000; } } } }
				 * } if(maxSalary == 0) { lex = null; String temp = ""; sr = new
				 * StringReader(map.getExpectation().getInfo()); ik = new
				 * IKSegmenter(sr, true); while ((lex = ik.next()) != null) {
				 * temp = lex.getLexemeText(); if (temp.contains("k")) {
				 * pattern1 = Pattern.compile("\\d{1,3}"); matcher1 =
				 * pattern1.matcher(temp); while (matcher1.find()) {
				 * if(Integer.parseInt(matcher1.group())*1000 > maxSalary) {
				 * maxSalary = Integer.parseInt(matcher1.group())*1000; } } } }
				 * } maxSalary = maxSalary * 12; } else if(yearOrmonth == 2) {
				 * //year Pattern pattern1 = Pattern.compile("\\d{4,7}");
				 * Matcher matcher1 =
				 * pattern1.matcher(map.getExpectation().getInfo()); while
				 * (matcher1.find()) { if(Integer.parseInt(matcher1.group()) >
				 * maxSalary) { maxSalary = Integer.parseInt(matcher1.group());
				 * } } if(maxSalary == 0) { lex = null; String temp = ""; sr =
				 * new StringReader(map.getExpectation().getInfo()); ik = new
				 * IKSegmenter(sr, true); while ((lex = ik.next()) != null) {
				 * temp = lex.getLexemeText(); if (temp.contains("万")) {
				 * pattern1 = Pattern.compile("\\d{1,3}"); matcher1 =
				 * pattern1.matcher(temp); while (matcher1.find()) {
				 * if(Integer.parseInt(matcher1.group())*10000 > maxSalary) {
				 * maxSalary = Integer.parseInt(matcher1.group())*10000; } } } }
				 * } if(maxSalary == 0) { lex = null; String temp = ""; sr = new
				 * StringReader(map.getExpectation().getInfo()); ik = new
				 * IKSegmenter(sr, true); while ((lex = ik.next()) != null) {
				 * temp = lex.getLexemeText(); if (temp.contains("k")) {
				 * pattern1 = Pattern.compile("\\d{1,3}"); matcher1 =
				 * pattern1.matcher(temp); while (matcher1.find()) {
				 * if(Integer.parseInt(matcher1.group())*1000 > maxSalary) {
				 * maxSalary = Integer.parseInt(matcher1.group())*1000; } } } }
				 * } } //
				 */
				// System.out.println("maxSalary = " + maxSalary);
				if (maxSalary <= 0) {
					map.getBasic().getExpectedSalary().setId(148);
				} else if (maxSalary > 0 && maxSalary < 50000) {
					map.getBasic().getExpectedSalary().setId(67);
				} else if (maxSalary >= 50000 && maxSalary < 100000) {
					map.getBasic().getExpectedSalary().setId(68);
				} else if (maxSalary >= 100000 && maxSalary < 200000) {
					map.getBasic().getExpectedSalary().setId(69);
				} else if (maxSalary >= 200000 && maxSalary < 300000) {
					map.getBasic().getExpectedSalary().setId(70);
				} else if (maxSalary >= 300000 && maxSalary < 500000) {
					map.getBasic().getExpectedSalary().setId(71);
				} else if (maxSalary >= 500000 && maxSalary < 1000000) {
					map.getBasic().getExpectedSalary().setId(72);
				} else if (maxSalary >= 1000000) {
					map.getBasic().getExpectedSalary().setId(73);
				}
			}
		}
		/*
		 * System.out.println("================ expectation =================="
		 * ); System.out.println("expected job = " +
		 * map.getBasic().getExpectedJob()); System.out.println(
		 * "expected city = " + map.getBasic().getExpectedCity());
		 * System.out.println("expected salary = " +
		 * map.getBasic().getExpectedSalary()); System.out.println(
		 * "================ expectation end ==================");
		 */

		// 补充工作年限
		if (map.getBasic() != null) {
			if (true) {
				int maxJobTime = 0;
				int minJobTime = 3000;
				if (map.getJobs() != null)
					for (Job jobOne : map.getJobs()) {
						// System.out.println("start time = " +
						// jobOne.getStartTime());
						// System.out.println("end time = " +
						// jobOne.getEndTime());
						Pattern pattern1 = Pattern.compile(
								"((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))|(0000)");
						Matcher matcher1 = pattern1.matcher(jobOne.getStartTime());
						while (matcher1.find()) {
							// System.out.println(Integer.parseInt(matcher1.group()));
							if (Integer.parseInt(matcher1.group()) < minJobTime) {
								minJobTime = Integer.parseInt(matcher1.group());
							}
						}
						pattern1 = Pattern.compile(
								"((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))|(0000)");
						matcher1 = pattern1.matcher(jobOne.getEndTime());
						while (matcher1.find()) {
							// System.out.println(Integer.parseInt(matcher1.group()));
							if (Integer.parseInt(matcher1.group()) == 0) {
								Calendar a = Calendar.getInstance();
								// System.out.println("current year = " +
								// a.get(Calendar.YEAR));
								maxJobTime = a.get(Calendar.YEAR);
							} else {
								if (Integer.parseInt(matcher1.group()) > maxJobTime) {
									maxJobTime = Integer.parseInt(matcher1.group());
								}
							}
						}
					}
				// System.out.println("max time = " + maxJobTime);
				// System.out.println("min time = " + minJobTime);
				if (maxJobTime > minJobTime) {
					Long longJobTime = new Long((long) (maxJobTime - minJobTime));
					map.getBasic().setJob_time(longJobTime);
				}
			}
		}

		// 补充教育经历
		int maxTime = 0;
		if (map.getEducations() != null)
			for (EducationNow education : map.getEducations()) {
				if (education.getDegree().getId() > map.getBasic().getDegree().getId()) {
					// System.out.println(">");
					map.getBasic().setDegree(education.getDegree());
					map.getBasic().setSchool(education.getSchool());
					if (map.getBasic().getSchool().length() > 22) {
						map.getBasic().setSchool(map.getBasic().getSchool().substring(0, 21));
					}
					map.getBasic().setMajor(education.getMajor());
					// System.out.println(map.getBasic().getMajor());
					// System.out.println(map.getBasic().getDegree());
					// System.out.println(map.getBasic().getSchool());
				} else if (education.getDegree().getId() == map.getBasic().getDegree().getId()) {
					// System.out.println(education.getEndTime());
					Pattern pattern1 = Pattern.compile("((19\\d{2}|20\\d{2}))|(0000)");
					Matcher matcher1 = pattern1.matcher(education.getEndTime());
					// System.out.println("endTime = " +
					// education.getEndTime());
					while (matcher1.find()) {
						String strstr = matcher1.group();
						int tempTime = Integer.parseInt(strstr);
						// System.out.println("tempTime = " + tempTime);
						if (tempTime == 0) {
							Calendar a = Calendar.getInstance();
							tempTime = a.get(Calendar.YEAR);
						}
						if (tempTime > maxTime) {
							map.getBasic().setDegree(education.getDegree());
							map.getBasic().setSchool(education.getSchool());
							if (map.getBasic().getSchool().length() > 22) {
								map.getBasic().setSchool(map.getBasic().getSchool().substring(0, 21));
							}
							map.getBasic().setMajor(education.getMajor());
							maxTime = tempTime;
						}
					}
				}
			}

		// 最后一次筛选名字 ,原始文本

		if (map.getBasic().getName() == null || map.getBasic().getName().equals("人才")) {
			String name = detectName1(content);
			if (name != null) {
				map.getBasic().setName(name);
			} else
				map.getBasic().setName("人才");
			System.out.println("name:" + name);
		}
		// 伪名字
		if (checkName(map)) {
			String name = detectName1(content);
			if (name != null) {
				map.getBasic().setName(name);
			} else
				map.getBasic().setName("人才");
			System.out.println("name:" + name);

			checkName(map);
		}

		degree = "";
		gender = "";
		age = "";
		email = "";
		phone = "";
		jobtime = "";
		// System.out.println("Name = " + map.getBasic().getName());
		/// *
		// System.out.println("西安飞机工业(集团)有限责任公司职工工学院".length());
		// System.out.println("Shanxi Jincheng Anthracite Coal Mining
		// Group".length());
		System.out.println("基本信息：");
		System.out.println("Basic Name = " + map.getBasic().getName());
		System.out.println("Basic Gender = " + map.getBasic().getGender());
		System.out.println("Basic School = " + map.getBasic().getSchool());
		System.out.println("Basic Major = " + map.getBasic().getMajor());
		System.out.println("Basic Age = " + map.getBasic().getAge());
		System.out.println("Basic Company = " + map.getBasic().getCompany());
		System.out.println("Basic Title = " + map.getBasic().getTitle());
		System.out.println("Basic Email = " + map.getBasic().getEmail());
		System.out.println("Basic Phone = " + map.getBasic().getMobile());
		System.out.println("Basic Degree = " + map.getBasic().getDegree().getId());
		System.out.println("Basic Birthday = " + map.getBasic().getBirthday());
		System.out.println("Basic City = " + map.getBasic().getCity());
		System.out.println("Basic Marriage = " + map.getBasic().getMarriage());
		System.out.println("Basic Politics = " + map.getBasic().getPolitics());
		System.out.println("Basic JobTime = " + map.getBasic().getJob_time());
		System.out.println("Basic Status = " + map.getBasic().getJobStatus().getId());
		System.out.println("Basic ExpectationJob = " + map.getBasic().getExpectedJob());
		System.out.println("Basic ExpectationSalary = " + map.getBasic().getExpectedSalary().getId());
		System.out.println("Basic ExpectationCity = " + map.getBasic().getExpectedCity());
		System.out.println("");

		System.out.println("教育经历：");
		List<EducationNow> eList = map.getEducations();
		if (eList != null)
			for (EducationNow eListOne : eList) {
				System.out.println("时间：" + eListOne.getStartTime() + "-" + eListOne.getEndTime() + "	学校："
						+ eListOne.getSchool() + "	学位：" + eListOne.getDegree().getId() + "	专业：" + eListOne.getMajor());
			}
		System.out.println("");

		System.out.println("工作经历：");
		List<Job> jList = map.getJobs();
		if (jList != null)
			for (Job jListOne : jList) {
				System.out.println("时间：" + jListOne.getStartTime() + "-" + jListOne.getEndTime() + "	公司："
						+ jListOne.getCompany() + "	职位：" + jListOne.getTitle() + "	部门：" + jListOne.getDepartment()
						+ "	职责：" + jListOne.getDuty() + "	成果：" + jListOne.getAchieve());
			}
		System.out.println("");

		System.out.println("奖励：");
		List<Medal> mList = map.getMedals();
		if (mList != null)
			for (Medal mListOne : mList) {
				System.out.println("时间：" + mListOne.getGetTime() + "	奖项名字：" + mListOne.getMedalName() + "	奖项信息："
						+ mListOne.getMedalInfo());
			}
		System.out.println("");

		System.out.println("项目经历：");
		List<Project> pList = map.getProjects();
		if (pList != null)
			for (Project pListOne : pList) {
				System.out.println("时间：" + pListOne.getStartTime() + "-" + pListOne.getEndTime() + "	项目名称："
						+ pListOne.getInfo() + "	公司：" + pListOne.getCompany() + "	内容：" + pListOne.getContent()
						+ "	成果：" + pListOne.getAchieve());
			}
		System.out.println("");

		System.out.println("论文：");
		List<Paper> paperList = map.getPapers();
		if (paperList != null)
			for (Paper paperListOne : paperList) {
				System.out.println("作者：" + paperListOne.getAuthor() + "	标题：" + paperListOne.getTitle() + "	期刊："
						+ paperListOne.getMagazine() + "	时间：" + paperListOne.getTime());
			}
		System.out.println("");

		System.out.println("专利：");
		List<Patent> patentList = map.getPatents();
		if (patentList != null)
			for (Patent patentListOne : patentList) {
				System.out.println("作者：" + patentListOne.getInventor() + "	专利名：" + patentListOne.getInfo() + "	专利号："
						+ patentListOne.getPatentId() + "	时间：" + patentListOne.getTime());
			}
		System.out.println("");

		System.out.println("技能：");
		List<Skill> sList = map.getSkills();
		if (sList != null)
			for (Skill sListOne : sList) {
				System.out.println("名称：" + sListOne.getSkillName() + "	技能详细信息：" + sListOne.getSkillInfo());
			}
		System.out.println("");

		System.out.println("自我评价：");
		List<Comment> cList = map.getComments();
		if (cList != null)
			for (Comment cListOne : cList) {
				System.out.println("评论：" + cListOne.getCommentInfo());
			}
		System.out.println("");

		System.out.println("期望：");
		if (map.getExpectation() != null)
			System.out.println("期望： " + map.getExpectation().getExpectationInfo());
		// */
		// System.out.println("------------------Json start-----------------");
		// System.out.println(JSONUtil.ObjectToJSON(map));
		// System.out.println("------------------Json end-----------------");
		return 0;
	}

	/**
	 * 检测名字是否合法zzh
	 * 
	 * @param map
	 */
	private boolean checkName(CVObject map) {

		if (!map.getBasic().getName().equals("人才")) {
			if (m_UserDic.get(map.getBasic().getName()) != null) {
				map.getBasic().setName("人才");
				return true;
			}
		}
		return false;
	}
	
	/**
	 * 检测名字是否合法zzh
	 * 
	 * @param String
	 */
	private boolean checkName2(String name) {

		if (!name.equals("人才")) {
			if (m_UserDic.get(name)!= null) { 
				return true;
			}
		}
		return false;
	}

	/**
	 * 解析其他信息模块
	 * 
	 * @param info
	 * @param map
	 */
	private void parseOther(String info, CVObject map, int[][] indexType, int flag) {

	}

	/**
	 * 函数名：parseSkill() 功 能：识别技能信息块的内容
	 * 
	 * @throws IOException
	 */
	private void parseSkill(String info, CVObject map, int[][] indexType, int flag) throws IOException {
		// System.out.println("parseSkill");
		List<Skill> skills = new ArrayList<Skill>();
		if (map.getSkills() != null) {
			skills = map.getSkills();
		}
		info = info.replaceAll("||    ||||", "");
		// System.out.println(info);
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<Medal> mList = new ArrayList<Medal>();
		// 解析IT技能
		Pattern pattern = Pattern.compile("精通|熟悉|了解|熟练|一般|良好");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());
		}
		for (int i = 0, len = iList.size(); i < len; i++) {
			if (i == len - 1) {
				// System.out.println(info.substring(iList.get(i),
				// info.length()));
				Lexeme lex = null;
				StringReader sr = new StringReader(info.substring(iList.get(i), info.length()));
				IKSegmenter ik = new IKSegmenter(sr, true);
				StringBuilder sSkillName = new StringBuilder();
				String str = "";
				while ((lex = ik.next()) != null) {
					String tmp = "";
					tmp = lex.getLexemeText();
					// System.out.println(tmp);
					if (m_UserDic.containsKey(tmp)) {
						if (m_UserDic.get(tmp) == 17 || m_UserDic.get(tmp) == 13) {
							int tmpflag = 1;
							for (Skill skillOne : skills) {
								if (skillOne.getSkillName().equals(tmp)) {
									tmpflag = 0;
									break;
								}
							}
							if (tmpflag == 1) {
								Skill skill = new Skill();
								skill.setSkillName(tmp);
								// skill.setInfo(info.substring(iList.get(i),
								// info.length()));
								skill.setSkillInfo(sList.get(i));
								skills.add(skill);
								// System.out.println("skill name = " +
								// skill.getSkillName() + " level = " +
								// skill.getSkillInfo());
							}
						}
					}
				}
			} else {
				// System.out.println(info.substring(iList.get(i),
				// iList.get(i+1)));
				Lexeme lex = null;
				StringReader sr = new StringReader(info.substring(iList.get(i), iList.get(i + 1)));
				IKSegmenter ik = new IKSegmenter(sr, true);
				StringBuilder sSkillName = new StringBuilder();
				String str = "";
				while ((lex = ik.next()) != null) {
					String tmp = "";
					tmp = lex.getLexemeText();
					// System.out.println(tmp);
					if (m_UserDic.containsKey(tmp)) {
						if (m_UserDic.get(tmp) == 17 || m_UserDic.get(tmp) == 13) {
							int tmpflag = 1;
							for (Skill skillOne : skills) {
								if (skillOne.getSkillName().equals(tmp)) {
									tmpflag = 0;
									break;
								}
							}
							if (tmpflag == 1) {
								Skill skill = new Skill();
								skill.setSkillName(tmp);
								// skill.setInfo(info.substring(iList.get(i),
								// info.length()));
								skill.setSkillInfo(sList.get(i));
								skills.add(skill);
								// System.out.println("skill name = " +
								// skill.getSkillName() + " level = " +
								// skill.getSkillInfo());
							}
						}
					}
				}
			}
		}
		if (iList.size() == 0) {
			Lexeme lex = null;
			StringReader sr = new StringReader(info);
			IKSegmenter ik = new IKSegmenter(sr, true);
			StringBuilder sSkillName = new StringBuilder();
			String str = "";
			try {
				while ((lex = ik.next()) != null) {
					String tmp = "";
					// sSkillName.delete(0, sSkillName.length());
					tmp = lex.getLexemeText();
					// System.out.println(tmp);
					if (m_UserDic.containsKey(tmp)) {
						if (m_UserDic.get(tmp) == 17 || m_UserDic.get(tmp) == 13) {
							Skill skill = new Skill();
							skill.setSkillName(tmp);
							// skill.setInfo(info.trim());
							skill.setSkillInfo("");
							skills.add(skill);
							// map.setSkills(skills);
						}
					}
				}
				// Skill skill = new Skill();
				// skill.setSkillName(sSkillName.toString());
				// skill.setInfo(info.trim());
				// skill.setSkillInfo("");
				// skills.add(skill);
				// map.setSkills(skills);
				// skill = null;
			} catch (IOException e) {
				e.printStackTrace();
			}
		}

		// 解析英语技能

		Lexeme lex = null;
		StringReader sr = new StringReader(info);
		IKSegmenter ik = new IKSegmenter(sr, true);
		StringBuilder sSkillName = new StringBuilder();
		String str = "";
		/*
		 * List<Skill> skills = new ArrayList<Skill>(); if(map.getSkills() !=
		 * null) { skills = map.getSkills(); } //
		 */
		/*
		 * try { while ((lex = ik.next()) != null) { String tmp = "";
		 * //sSkillName.delete(0, sSkillName.length()); tmp =
		 * lex.getLexemeText(); //System.out.println(tmp); if
		 * (m_UserDic.containsKey(tmp)) { if (m_UserDic.get(tmp) == 0) {
		 * sSkillName.append(tmp +"  ");
		 * 
		 * Skill skill = new Skill(); skill.setSkillName(sSkillName.toString());
		 * skill.setInfo(info.trim()); skill.setSkillInfo(info.trim());
		 * skills.add(skill); map.setSkills(skills); skill = null;
		 * 
		 * } } } } catch (IOException e) { e.printStackTrace(); } //
		 */
		// System.out.println("map.skills before = " + map.getSkills());

		/*
		 * Skill skill = new Skill(); skill.setSkillName(sSkillName.toString());
		 * skill.setInfo(info.trim()); skill.setSkillInfo(info.trim()); //
		 */

		// System.out.println("skill" + skill.toString() );

		/*
		 * List<Skill> skills = new ArrayList<Skill>(); if(map.getSkills() !=
		 * null) { skills = map.getSkills(); } //
		 */

		// List<Skill> skills = new ArrayList<Skill>();

		/// *
		// skills.add(skill);
		map.setSkills(skills);
		// */

		// System.out.println("map.skills after = " + map.getSkills());

		// skill = null;
		skills = null;
		if (flag == 1) {
			for (int i = 0; i < 11; i++) {
				if (indexType[0][i] == 0) {
					switch (indexType[1][i]) {
					case 0:
						parseBasic(info, map, indexType, 0);
						if (map.getBasic().getName() == null || map.getBasic().getName().equals("")) {
							// detectName(content,map);
						}
						break;
					case 1:
						// parseEducation(info,map,indexType,0);
						break;
					case 2:
						// parseJob(info,map,indexType,0);
						break;
					case 3:
						// parseProject(info,map,indexType,0);
						break;
					case 4:
						// parseMedal(info,map,indexType,0);
						break;
					case 5:
						// parseSkill(info,map,indexType,0);
						break;
					case 6:
						// parsePaper(info,map,indexType,0);
						break;
					case 7:
						// parsePatent(info,map,indexType,0);
						break;
					case 8:
						// parseComment(info,map,indexType,0);
						break;
					case 9:
						// parseExpectation(info,map,indexType,0);
						break;
					case 10:
						// parseOther(info,map,indexType,0);
						break;
					default:
						break;
					}
				}
			}
		}
	}

	/**
	 * 函数名：parseComment() * 功 能：识别自我评价信息块的内容
	 * 
	 * @throws IOException
	 */
	private void parseComment(String info, CVObject map, int[][] indexType, int flag) throws IOException {
		info = info.replaceAll("||    |||", "");
		Lexeme lex = null;
		StringReader sr = new StringReader(info);
		IKSegmenter ik = new IKSegmenter(sr, true);
		String str = "";
		try {
			while ((lex = ik.next()) != null) {
				String tmp = "";
				tmp = lex.getLexemeText();
				if (m_UserDic.containsKey(tmp)) {
					if (m_UserDic.get(tmp) == 108) {
						str = tmp;
						info = info.replaceFirst(tmp, "");
					}
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		Comment comment = new Comment();
		if (info.trim().length() < 500) {
			comment.setInfo(info.trim());
			comment.setCommentInfo(info.trim());
		}
		List<Comment> comments = new ArrayList<Comment>();
		if (map.getComments() != null) {
			comments = map.getComments();
		}
		comments.add(comment);
		map.setComments(comments);
		comment = null;
		comments = null;
		if (flag == 1) {
			for (int i = 0; i < 11; i++) {
				if (indexType[0][i] == 0) {
					switch (indexType[1][i]) {
					case 0:
						parseBasic(info, map, indexType, 0);
						if (map.getBasic().getName() == null || map.getBasic().getName().equals("")) {
							// detectName(content,map);
						}
						break;
					case 1:
						// parseEducation(info,map,indexType,0);
						break;
					case 2:
						// parseJob(info,map,indexType,0);
						break;
					case 3:
						// parseProject(info,map,indexType,0);
						break;
					case 4:
						// parseMedal(info,map,indexType,0);
						break;
					case 5:
						// parseSkill(info,map,indexType,0);
						break;
					case 6:
						// parsePaper(info,map,indexType,0);
						break;
					case 7:
						// parsePatent(info,map,indexType,0);
						break;
					case 8:
						// parseComment(info,map,indexType,0);
						break;
					case 9:
						// parseExpectation(info,map,indexType,0);
						break;
					case 10:
						// parseOther(info,map,indexType,0);
						break;
					default:
						break;
					}
				}
			}
		}
	}

	/* 将期望信息分为七个信 息域 */

	/**
	 * 函数名：parseExpectationl() 功 能：识别求职期望信息块的内容
	 * 
	 * @param info
	 * @param map
	 * @param indexType
	 * @param flag
	 * @throws IOException
	 */
	private void parseExpectation(String info, CVObject map, int[][] indexType, int flag) throws IOException {
		info = info.replaceAll("||    |||", "");
		// 去掉多余的制表符
		info = info.replaceAll("\\s+|\\t|\\r", "");
		Lexeme lex = null;
		StringReader sr = new StringReader(info);
		IKSegmenter ik = new IKSegmenter(sr, true);

		int[][] indexs_exp = new int[2][10];// 存储七个模块首个字符索引位置
		// 初始化
		for (int i = 0; i < 10; i++) {
			indexs_exp[0][i] = info.length();
		}
		indexs_exp[0][0] = 0;
		indexs_exp[1][0] = 0;
		int ii = 0;// 记录出现次序

		while ((lex = ik.next()) != null) {
			if (m_UserDic.containsKey(lex.getLexemeText())) {
				int type = m_UserDic.get(lex.getLexemeText());

				switch (type) {
				case 109: /* 求职意向 */
					break;
				case 220: // 期望行业

					indexs_exp[0][ii] = lex.getBeginPosition();
					indexs_exp[1][ii] = 220;
					ii++;
					break;
				case 221: // 期望职位

					indexs_exp[0][ii] = lex.getBeginPosition();
					indexs_exp[1][ii] = 221;
					ii++;
					break;
				case 222: // 期望城市

					indexs_exp[0][ii] = lex.getBeginPosition();
					indexs_exp[1][ii] = 222;
					ii++;
					break;
				case 223: // 期望薪资

					indexs_exp[0][ii] = lex.getBeginPosition();
					indexs_exp[1][ii] = 223;
					ii++;
					break;
				case 224: // 到岗时间

					indexs_exp[0][ii] = lex.getBeginPosition();
					indexs_exp[1][ii] = 224;
					ii++;
					break;
				case 225: // 工作类型

					indexs_exp[0][ii] = lex.getBeginPosition();
					indexs_exp[1][ii] = 225;
					ii++;
					break;
				case 226: // 求职状态

					indexs_exp[0][ii] = lex.getBeginPosition();
					indexs_exp[1][ii] = 226;
					ii++;
					break;
				case 0: // 期望职位
					if (lex.getLexemeText().equals("职能")) {
						indexs_exp[0][ii] = lex.getBeginPosition();
						indexs_exp[1][ii] = 221;
						ii++;
					}
					break;

				}

			}

		}
		// 分块排序
		insertsort(indexs_exp);

		int[][] index_not_null = new int[2][11];//
		for (int i = 0; i < 11; i++) {
			index_not_null[0][i] = 0;
			index_not_null[1][i] = i;

		}
		// 查看哪些模块有值
		for (int i = 0; i < 10; i++) {
			switch (index_not_null[1][i]) {
			case 220:
				index_not_null[0][0] = 1;
				break;
			case 221:
				index_not_null[0][1] = 1;
				break;
			case 222:
				index_not_null[0][2] = 1;
				break;
			case 223:
				index_not_null[0][3] = 1;
				break;
			case 224:
				index_not_null[0][4] = 1;
				break;
			case 225:
				index_not_null[0][5] = 1;
				break;
			case 226:
				index_not_null[0][6] = 1;
				break;
			default:
				break;
			}
		}
		String expectationIndustryValue = null, //
				expectationFunctionValue = null, //
				expectationCityValue = null, //
				expectationSalaryValue = null, //
				expectationCompany = null, //
				expectationTitle = null, //
				expectationInfo = null; //

		// Expectation expectation = new Expectation();
		// 开始解析
		for (int i = 0, len = 10; i < len; i++) {

			String tmp = "";
			if (i < 9) {
				tmp = info.substring(indexs_exp[0][i], indexs_exp[0][i + 1]);
			} else {
				tmp = info.substring(indexs_exp[0][i], info.length());
			}
			tmp = tmp.replace("\n", "");
			if (tmp.indexOf(":") != -1)
				switch (indexs_exp[1][i]) {

				case 220: // 行业: 计算机软件
					expectationIndustryValue = tmp.substring(tmp.indexOf(":") + 1);
					break;
				case 221: // 职能:软件工程师
					expectationFunctionValue = tmp.substring(tmp.indexOf(":") + 1);
					expectationTitle = expectationFunctionValue;
					break;
				case 222:// 地点:北京
					expectationCityValue = tmp.substring(tmp.indexOf(":") + 1);
					break;
				case 223: // 期望薪资: 20000-24999元/月
					expectationSalaryValue = tmp.substring(tmp.indexOf(":") + 1);
					break;
				case 224:// 到岗时间:随时

					break;
				case 225:// 工作类型:全职

					break;
				case 226:// 求职状态

					break;
				}

		}
		// 行业
		String[] trade = { "IT", "互联网", "通信", "电子", "建设工程", "房地产", "物业管理", "金融", "消费品", "机械", "制造", "汽车", "车联网", "咨询",
				"公众服务", "外包", "文化", "传媒", "广告", "公关", "教育培训", "物流", "仓储", "运输", "贸易", "进出口", "医疗", "卫生", "健康", "能源",
				"化工", "环保", "政府", "公共事业", "农林牧渔", "其它", "计算机" };

		Expectation expectation = new Expectation();
		expectation.setExpectationInfo(info.toString().trim());
		// 职位
		if (expectationIndustryValue != null) {
			if (expectationTitle != null)
				expectation.setExpectationTitle(expectationTitle + " (" + expectationIndustryValue + ")");
			else
				expectation.setExpectationTitle(expectationIndustryValue);
		} else {
			expectation.setExpectationTitle(expectationTitle);
		}
		// 行业
		if (expectationIndustryValue != null && !expectationIndustryValue.equals(""))
			for (int i = 0; i < trade.length; i++) {
				if (expectationIndustryValue.indexOf(trade[i]) != -1) {
					expectation.setExpectationIndustryId((long) (i + 1));
				}
			}
		// 职能--过于繁琐此处不处理了马丹

		// 薪资 换算为以年为单位
		if (expectationSalaryValue != null) { 
			expectation.setExpectationCityValue(expectationSalaryValue);
			Pattern p = Pattern.compile("\\d+");
			Matcher m = p.matcher(expectationSalaryValue);
			int expected_salary = 0;
			if (m.find()) {
				expected_salary = Integer.parseInt(m.group());
			}
			if (0 != expected_salary)
				if (expectationSalaryValue.indexOf("年") != -1) {
					if (expectationSalaryValue.indexOf("万") != -1) {
						int expected_salary_ayear = expected_salary * 10000;

						/* 根据年薪得到对应id */
						int salaryId = getSalaryId(expected_salary_ayear);
						expectation.setExpectationSalary((long) salaryId);

					} else {

						int expected_salary_ayear = expected_salary;

						/* 根据年薪得到对应id */
						int salaryId = getSalaryId(expected_salary_ayear);
						expectation.setExpectationSalary((long) salaryId);

					}

				} else if (expectationSalaryValue.indexOf("月") != -1) {

					int expected_salary_ayear = expected_salary * 12;
					/* 根据年薪得到对应id */
					int salaryId = getSalaryId(expected_salary_ayear);
					expectation.setExpectationSalary((long) salaryId);

				}
		}
		// 城市地点 n
		// 加载城市列表
		Map citymap = new HashMap();
		InputStream in = Constants.class.getResourceAsStream(Constants.city);
		BufferedReader br = new BufferedReader(new InputStreamReader(in, "utf-8"));
		String tmp = null;
		int i = 0;
		while ((tmp = br.readLine()) != null) {
			citymap.put(tmp, ++i);
		}

		if (expectationCityValue != null && !expectationCityValue.trim().equals("")) { 
			expectation.setExpectationCityValue(expectationCityValue); 
			// 期望城市只选一个 沈阳,营口
			// ik分词
			StringReader reader = new StringReader(expectationCityValue);
			IKSegmenter ikS = new IKSegmenter(reader, true);
			Lexeme lexeme = null;
			String city = null;
			if ((lexeme = ikS.next()) != null) { // while
				city = lexeme.getLexemeText();
			}

			Integer cityId = (Integer) citymap.get(city);
			if (cityId != null) { 
				expectation.setExpectationCityId((long) cityId);
			} else {
				// 从city_simple中获取城市

				Map citymap2 = new HashMap();
				InputStream inS = Constants.class.getResourceAsStream(Constants.city_simple);
				BufferedReader br2 = new BufferedReader(new InputStreamReader(inS, "utf-8"));
				String tmp2 = null;
				int i2 = 0;
				while ((tmp2 = br2.readLine()) != null) {
					citymap2.put(tmp2, ++i2);
				}

				Integer cityId2 = (Integer) citymap2.get(city);
				if (cityId2 != null)
					expectation.setExpectationCityId((long) cityId2);
				inS.close();
			}
		}

		map.setExpectation(expectation);
		// map.getBasic().getExpectedSalary();

	}

	@Test
	public void test001() {
		String str = "da/月";
		System.out.println(str.indexOf("月"));
	}

	@Test
	public void cityListTest() {
		InputStream in = null;
		// 加载城市列表
		try {
			Map citymap = new HashMap();
			in = Constants.class.getResourceAsStream(Constants.city_simple);
			BufferedReader br = new BufferedReader(new InputStreamReader(in,"utf-8"));
			String tmp = null;
			int i = 0;
			while ((tmp = br.readLine()) != null) {
				citymap.put(tmp, ++i);
			}
			Integer city = (Integer) citymap.get("天津");
			System.out.println(city);
			in.close();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	private int getSalaryId(int expected_salary_ayear) {
		int salaryId = 0;
		if (expected_salary_ayear <= 0) {
			salaryId = 148;
		} else if (expected_salary_ayear > 0 && expected_salary_ayear < 50000) {
			salaryId = 67;
		} else if (expected_salary_ayear >= 50000 && expected_salary_ayear < 100000) {
			salaryId = 68;
		} else if (expected_salary_ayear >= 100000 && expected_salary_ayear < 200000) {
			salaryId = 69;
		} else if (expected_salary_ayear >= 200000 && expected_salary_ayear < 300000) {
			salaryId = 70;
		} else if (expected_salary_ayear >= 300000 && expected_salary_ayear < 500000) {
			salaryId = 71;
		} else if (expected_salary_ayear >= 500000 && expected_salary_ayear < 1000000) {
			salaryId = 72;
		} else if (expected_salary_ayear >= 1000000) {
			salaryId = 73;
		}
		return salaryId;
	}

	/**
	 * 函数名：parseMedal() 功 能：识别获奖情况信息块的起止时间、奖励内容
	 * 
	 * @throws IOException
	 */
	private void parseMedal(String info, CVObject map, int[][] indexType, int flag) throws IOException {
		info = info.replaceAll("||    |||", "");
		// System.out.println("medal info");
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<Medal> mList = new ArrayList<Medal>();
		if (map.getMedals() != null) {
			mList = map.getMedals();
		}
		Pattern pattern = Pattern.compile(
				"((19\\d{2}|20\\d{2})-(19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})\\/0\\d{1})|((19\\d{2}|20\\d{2})\\/11)|((19\\d{2}|20\\d{2})\\/12)|((19\\d{2}|20\\d{2})-0\\d{1})|((19\\d{2}|20\\d{2})-11)|((19\\d{2}|20\\d{2})-12)|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.0\\d{1})|((19\\d{2}|20\\d{2})\\.11)|((19\\d{2}|20\\d{2})\\.12)|现在|至今|到现在|目前");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());
		}
		int length = info.length();
		String medal = "";
		int type = 0;
		int iContent = 0;
		boolean bContent = false;
		for (int i = 0, len = iList.size(); i < len; i++) {
			if (iList.size() > 0) {
				if (i == 0) {
					medal = info.substring(iList.get(0), len == 1 ? length : iList.get(1)).replaceAll(sList.get(0), "");
					Medal medalinfo = new Medal();
					String text = sList.get(i);
					medalinfo.setGetTime(getStartTimeMedal(text));
					medalinfo.setInfo(medal);
					medalinfo.setMedalInfo(info.trim());
					// System.out.println("medalinfo" + medalinfo.toString() );
					mList.add(medalinfo);
					medalinfo = null;
				} else if (i <= len - 2) {
					medal = info.substring(iList.get(i), iList.get(i + 1)).replaceAll(sList.get(i), "");
					Medal medalinfo = new Medal();
					String text = sList.get(i);
					medalinfo.setGetTime(getStartTimeMedal(text));
					medalinfo.setInfo(medal);
					medalinfo.setMedalInfo(info.trim());
					// System.out.println("medalinfo" + medalinfo.toString() );
					mList.add(medalinfo);
					medalinfo = null;
				} else {
					medal = info.substring(iList.get(i), length).replaceAll(sList.get(i), "");
					Medal medalinfo = new Medal();
					String text = sList.get(i);
					medalinfo.setGetTime(getStartTimeMedal(text));
					medalinfo.setInfo(medal);
					medalinfo.setMedalInfo(info.trim());
					// System.out.println("medalinfo" + medalinfo.toString() );
					mList.add(medalinfo);
					medalinfo = null;
				}
			} else {
				medal = info;
				Medal medalinfo = new Medal();
				medalinfo.setInfo(medal.trim());
				medalinfo.setMedalInfo(info.trim());
				// System.out.println("medalinfo" + medalinfo.toString() );
				mList.add(medalinfo);
				medalinfo = null;
			}
		}
		if (sList.size() == 0) {
			Medal medalinfo = new Medal();
			medalinfo.setInfo(medal);
			medalinfo.setMedalInfo(info.trim());
			// System.out.println("medalinfo" + medalinfo.toString() );
			mList.add(medalinfo);
			medalinfo = null;
		}
		map.setMedals(mList);
		iList = null;
		sList = null;
		mList = null;
		if (flag == 1) {
			for (int i = 0; i < 11; i++) {
				if (indexType[0][i] == 0) {
					switch (indexType[1][i]) {
					case 0:
						parseBasic(info, map, indexType, 0);
						if (map.getBasic().getName() == null || map.getBasic().getName().equals("")) {
							// detectName(content,map);
						}
						break;
					case 1:
						// parseEducation(info,map,indexType,0);
						break;
					case 2:
						// parseJob(info,map,indexType,0);
						break;
					case 3:
						// parseProject(info,map,indexType,0);
						break;
					case 4:
						// parseMedal(info,map,indexType,0);
						break;
					case 5:
						// parseSkill(info,map,indexType,0);
						break;
					case 6:
						// parsePaper(info,map,indexType,0);
						break;
					case 7:
						// parsePatent(info,map,indexType,0);
						break;
					case 8:
						// parseComment(info,map,indexType,0);
						break;
					case 9:
						// parseExpectation(info,map,indexType,0);
						break;
					case 10:
						// parseOther(info,map,indexType,0);
						break;
					default:
						break;
					}
				}
			}
		}
	}

	/**
	 * 函数名：parsePatent() * 功 能：识别专利与著作权。
	 * 
	 * @throws IOException
	 */
	private void parsePatent(String info, CVObject map, int[][] indexType, int flag) throws IOException {
		info = info.replaceAll("||    |||", "");
		Patent patentinfo = new Patent();
		patentinfo.setInfo(info.trim());
		patentinfo.setPatentInfo(info.trim());
		// System.out.println("patentinfo" + patentinfo.toString() );
		List<Patent> patents = new ArrayList<Patent>();
		if (map.getPatents() != null) {
			patents = map.getPatents();
		}

		String localInfo = info;
		// System.out.println("localInfo = " + localInfo);
		String[] stringList = localInfo.split("\r");
		for (String stringListOne : stringList) {
			Patent patentinfoTemp = new Patent();
			String[] stringListTemp = stringListOne.split("\\.|。");
			if (stringListTemp.length > 1) {
				// Patent patentinfoTemp = new Patent();
				for (int ii = 0; ii < stringListTemp.length; ii++) {
					switch (ii) {
					case 0:
						patentinfoTemp.setInventor(stringListTemp[ii]);
						break;
					case 1:
						// patentinfoTemp.setPatentName(stringListTemp[ii]);
						patentinfoTemp.setInfo(stringListTemp[ii]);
						break;
					default:
						Pattern pattern = Pattern
								.compile("([A-Za-z]{0,2})\\d{12}\\.\\d{1}|([A-Za-z]{0,2})\\d{12}\\.([0-9A-Za-z]+)");
						Matcher matcher = pattern.matcher(stringListTemp[ii]);
						while (matcher.find()) {
							patentinfoTemp.setPatentId(matcher.group());
							break;
						}
						pattern = Pattern.compile("19\\d{2}|20\\d{2}");
						matcher = pattern.matcher(stringListTemp[ii]);
						while (matcher.find()) {
							patentinfoTemp.setTime(matcher.group());
							break;
						}
						break;
					}
				}
				// patents.add(patentinfoTemp);
			}
			Pattern pattern = Pattern
					.compile("([A-Za-z]{0,2})\\d{12}\\.\\d{1}|([A-Za-z]{0,2})\\d{12}\\.([0-9A-Za-z]+)");
			Matcher matcher = pattern.matcher(stringListOne);
			while (matcher.find()) {
				patentinfoTemp.setPatentId(matcher.group());
				break;
			}
			if (patentinfoTemp.getPatentId() == null) {
			} else {
				patents.add(patentinfoTemp);
			}
		}
		/*
		 * for(Patent patent:patents) { System.out.println("Author: " +
		 * patent.getInventor() + "	Title: " + patent.getPatentName() +
		 * "	id: " + patent.getPatentId() + "	Time: " + patent.getTime());
		 * } //
		 */
		// patents.add(patentinfo);
		map.setPatents(patents);
		patents = null;
		patentinfo = null;
		if (flag == 1) {
			for (int i = 0; i < 11; i++) {
				if (indexType[0][i] == 0) {
					switch (indexType[1][i]) {
					case 0:
						parseBasic(info, map, indexType, 0);
						if (map.getBasic().getName() == null || map.getBasic().getName().equals("")) {
							// detectName(content,map);
						}
						break;
					case 1:
						// parseEducation(info,map,indexType,0);
						break;
					case 2:
						// parseJob(info,map,indexType,0);
						break;
					case 3:
						// parseProject(info,map,indexType,0);
						break;
					case 4:
						// parseMedal(info,map,indexType,0);
						break;
					case 5:
						// parseSkill(info,map,indexType,0);
						break;
					case 6:
						// parsePaper(info,map,indexType,0);
						break;
					case 7:
						// parsePatent(info,map,indexType,0);
						break;
					case 8:
						// parseComment(info,map,indexType,0);
						break;
					case 9:
						// parseExpectation(info,map,indexType,0);
						break;
					case 10:
						// parseOther(info,map,indexType,0);
						break;
					default:
						break;
					}
				}
			}
		}
	}

	/**
	 * 函数名：parsePaper() * 功 能：识别论文与著作
	 * 
	 * @throws IOException
	 */
	private void parsePaper(String info, CVObject map, int[][] indexType, int flag) throws IOException {
		info = info.replaceAll("||    |||", "");
		Paper paperinfo = new Paper();
		paperinfo.setInfo(info.trim());
		paperinfo.setPaperInfo(info.trim());
		List<Paper> papers = new ArrayList<Paper>();
		if (map.getPapers() != null) {
			papers = map.getPapers();
		}
		String localInfo = info;
		// System.out.println("localInfo = " + localInfo);
		String[] stringList = localInfo.split("\r");
		for (String stringListOne : stringList) {
			String[] stringListTemp = stringListOne.split("\\.");
			if (stringListTemp.length > 1) {
				Paper paperinfoTemp = new Paper();
				for (int ii = 0; ii < stringListTemp.length; ii++) {
					switch (ii) {
					case 0:
						paperinfoTemp.setAuthor(stringListTemp[ii]);
						break;
					case 1:
						paperinfoTemp.setTitle(stringListTemp[ii]);
						break;
					case 2:
						String[] paperinfoTempList = stringListTemp[ii].split(",");
						paperinfoTemp.setMagazine(paperinfoTempList[0]);

						// String[] paperinfoTempListFinal =
						// stringListTemp[ii].split(",");
						Pattern pattern = Pattern.compile("19\\d{2}|20\\d{2}");
						for (String paperinfoTempListFinalOne : paperinfoTempList) {
							paperinfoTempListFinalOne.replaceAll("-", "");
							paperinfoTempListFinalOne.replaceAll("\\.", "");
							Matcher matcher = pattern.matcher(paperinfoTempListFinalOne);
							while (matcher.find()) {
								paperinfoTemp.setTime(paperinfoTempListFinalOne);
								break;
							}
						}
						break;
					default:
						String[] paperinfoTempListFinal = stringListTemp[ii].split(",");
						pattern = Pattern.compile("19\\d{2}|20\\d{2}");
						for (String paperinfoTempListFinalOne : paperinfoTempListFinal) {
							paperinfoTempListFinalOne.replaceAll("-", "");
							paperinfoTempListFinalOne.replaceAll("\\.", "");
							Matcher matcher = pattern.matcher(paperinfoTempListFinalOne);
							while (matcher.find()) {
								paperinfoTemp.setTime(paperinfoTempListFinalOne);
								break;
							}
						}
						break;

					}
				}
				if (paperinfoTemp.getTitle() == null && paperinfoTemp.getMagazine() == null) {
				} else {
					papers.add(paperinfoTemp);
				}
			}
		}
		/*
		 * for(Paper paper:papers) { System.out.println("Author: " +
		 * paper.getAuthor() + "	Title: " + paper.getTitle() + "	Magzine: " +
		 * paper.getMagazine() + "	Time: " + paper.getTime()); } //
		 */
		// papers.add(paperinfo);
		map.setPapers(papers);
		paperinfo = null;
		if (flag == 1) {
			for (int i = 0; i < 11; i++) {
				if (indexType[0][i] == 0) {
					switch (indexType[1][i]) {
					case 0:
						parseBasic(info, map, indexType, 0);
						if (map.getBasic().getName() == null || map.getBasic().getName().equals("")) {
							// detectName(content,map);
						}
						break;
					case 1:
						// parseEducation(info,map,indexType,0);
						break;
					case 2:
						// parseJob(info,map,indexType,0);
						break;
					case 3:
						// parseProject(info,map,indexType,0);
						break;
					case 4:
						// parseMedal(info,map,indexType,0);
						break;
					case 5:
						// parseSkill(info,map,indexType,0);
						break;
					case 6:
						// parsePaper(info,map,indexType,0);
						break;
					case 7:
						// parsePatent(info,map,indexType,0);
						break;
					case 8:
						// parseComment(info,map,indexType,0);
						break;
					case 9:
						// parseExpectation(info,map,indexType,0);
						break;
					case 10:
						// parseOther(info,map,indexType,0);
						break;
					default:
						break;
					}
				}
			}
		}
	}

	/**
	 * parseProject2()精确分块识别项目信息
	 * 
	 * @param info
	 * @param map
	 * @param indexType
	 * @param flag
	 * @throws IOException
	 * @author zzh
	 */
	private void parseProject2(String info, CVObject map, int[][] indexType, int flag) throws IOException {

		info = info.replaceAll("||    |||", "");
		// 去掉多余的制表符
		info = info.replaceAll("\\s+|\\t|\\r", "");

		String regex = "((19\\d{2}|20\\d{2})-\\d{1,2})|" //
				+ "((19\\d{2}|20\\d{2})\\/\\d{1,2})|" //
				+ "((19\\d{2}|20\\d{2})年\\d{1,2}月)|" //
				+ "((19\\d{2}|20\\d{2})\\.\\d{1,2})|" //
				+ "现在|至今|到现在|目前 |今|" //
				+ "((19\\d{2}|20\\d{2})年)|" //
				+ "((19\\d{2}|20\\d{2}))";
		List<Integer> iList = new ArrayList<Integer>(); // 存放位置
		List<String> sList = new ArrayList<String>(); // 粗放匹配的日期字符

		Pattern pattern = Pattern.compile(regex);
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i + 1) - iList.get(i) >= 15) {
				iList.set(i, info.length() * 2);
				i++;
			} else {
				i = i + 2;
			}
		}
		// 移除不合理日期
		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i) == info.length() * 2) {
				iList.remove(i);
				sList.remove(i);
			} else {
				i++;
			}
		}
		// 奇数 -- 去掉多出来的日期
		if (iList.size() % 2 == 1) {
			iList.remove(iList.size() - 1);
			sList.remove(sList.size() - 1);
		}

		// 处理只有一个日期的情况
		if (iList.size() < 2) {
			System.out.println("无项目经历或项目经理无法解析");
		}
		List<Project> proList = new ArrayList<Project>();
		// 分块解析单个项目经历
		for (int i = 0; i < sList.size();) {
			Project pro = new Project();
			String tmp = null;
			if (i + 2 < sList.size()) {
				tmp = info.substring(iList.get(i), iList.get(i + 2));
				pro = parseOnePro(tmp, sList.get(i), sList.get(i + 1));
				i += 2;
			} else {
				tmp = info.substring(iList.get(i));
				pro = parseOnePro(tmp, sList.get(i), sList.get(i + 1));
				i += 2;
			}
			proList.add(pro);
		}

		map.setProjects(proList);

	}

	/**
	 * 解析单条项目经历
	 * 
	 * @param tmp
	 * @param startTime
	 * @param endTime
	 * @param map
	 * @throws IOException
	 *             抛出到上层
	 * 
	 */
	private Project parseOnePro(String projectText, String startTime, String endTime) throws IOException {
		// System.out.println(projectText);
		// 加载ik分词

		Lexeme lex = null;
		StringReader sr = new StringReader(projectText);
		IKSegmenter ik = new IKSegmenter(sr, true);

		int[][] indexs_pro = new int[2][10];// 存储七个模块首个字符索引位置
		// 初始化
		for (int i = 0; i < 10; i++) {
			indexs_pro[0][i] = projectText.length();
		}
		indexs_pro[0][0] = 0;
		indexs_pro[1][0] = 0;
		int ii = 0;// 记录出现次序

		while ((lex = ik.next()) != null) {
			if (m_UserDic.containsKey(lex.getLexemeText())) {
				int type = m_UserDic.get(lex.getLexemeText());
				switch (type) {
				case 310: // 项目名称
					indexs_pro[0][ii] = lex.getBeginPosition();
					indexs_pro[1][ii] = 310;
					ii++;
					break;
				case 311: // 所在公司
					indexs_pro[0][ii] = lex.getBeginPosition();
					indexs_pro[1][ii] = 311;
					ii++;
					break;
				case 307: // 软件环境
					indexs_pro[0][ii] = lex.getBeginPosition();
					indexs_pro[1][ii] = 307;
					ii++;
					break;
				case 308: // 开发工具
					indexs_pro[0][ii] = lex.getBeginPosition();
					indexs_pro[1][ii] = 308;
					ii++;
					break;
				case 309: // 开发环境
					indexs_pro[0][ii] = lex.getBeginPosition();
					indexs_pro[1][ii] = 309;
					ii++;
					break;
				case 306: // 项目描述
					indexs_pro[0][ii] = lex.getBeginPosition();
					indexs_pro[1][ii] = 306;
					ii++;
					break;
				case 301: // 项目职责
					indexs_pro[0][ii] = lex.getBeginPosition();
					indexs_pro[1][ii] = 301;
					ii++;
					break;
				case 302: // 项目成绩
					indexs_pro[0][ii] = lex.getBeginPosition();
					indexs_pro[1][ii] = 302;
					ii++;
					break;

				}

			}

		}
		// 分块排序
		insertsort(indexs_pro);

		String projectName = null, //
				company = null, //
				content = null, //
				duty = null, //
				achieve = null, //
				city = null, //
				projectInfo = null, // info
				softwareEnv = null, //
				devTools = null, //
				devEnv = null;

		// 解析头部 获取项目名、职务
		if(indexs_pro[0][0]!=0){
			String head = projectText.substring(projectText.indexOf(endTime) + endTime.length(), indexs_pro[0][0]);
			if (head != null && head.indexOf(":") != -1) {
				projectName = head.replace(":", "");
			}
			projectName = head;
		}
		  
		// Expectation expectation = new Expectation();
		// 开始解析
		for (int i = 0, len = 10; i < len; i++) {

			String tmp = "";
			if (i < 9) {
				tmp = projectText.substring(indexs_pro[0][i], indexs_pro[0][i + 1]);
			} else {
				tmp = projectText.substring(indexs_pro[0][i], projectText.length());
			}
			tmp = tmp.replace("\n", "");
			if (tmp.indexOf(":") != -1) {
				switch (indexs_pro[1][i]) {
				case 310: // 项目名称
					projectName = tmp.substring(tmp.indexOf(":") + 1);
					break;
				case 311: // 所在公司
					company = tmp.substring(tmp.indexOf(":") + 1);
					break;
				case 307: // 软件环境
					softwareEnv = tmp.substring(tmp.indexOf(":") + 1);
					break;
				case 308: // 开发工具
					devTools = tmp.substring(tmp.indexOf(":") + 1);
					break;
				case 309: // 开发环境
					devEnv = tmp.substring(tmp.indexOf(":") + 1);
					break;
				case 306: // 项目描述
					content = tmp.substring(tmp.indexOf(":") + 1);
					break;
				case 301: // 项目职责
					duty = tmp.substring(tmp.indexOf(":") + 1);
					break;
				case 302: // 项目成绩
					achieve = tmp.substring(tmp.indexOf(":") + 1);
					break;
				}
			} else {
				if (tmp.length() > 4)
					switch (indexs_pro[1][i]) {
					case 310: // 项目名称
						projectName = tmp.substring(5);
						break;
					case 311: // 所在公司
						company = tmp.substring(5);
						break;
					case 307: // 软件环境
						softwareEnv = tmp.substring(5);
						break;
					case 308: // 开发工具
						devTools = tmp.substring(5);
						break;
					case 309: // 开发环境
						devEnv = tmp.substring(5);
						break;
					case 306: // 项目描述
						content = tmp.substring(5);
						break;
					case 301: // 项目职责
						duty = tmp.substring(5);
						break;
					case 302: // 项目成绩
						achieve = tmp.substring(5);
						break;
					}

			}

		}

		if (softwareEnv != null && !softwareEnv.equals("")) {
			content += softwareEnv;
		}
		if (devTools != null && !devTools.equals("")) {
			content += devTools;
		}
		if (devEnv != null && !devEnv.equals("")) {
			content += devEnv;
		}

		Project pro = new Project();

		pro.setStartTime(timeStanderFormat(startTime));
		pro.setEndTime(timeStanderFormat(endTime));

		if (projectName != null && !projectName.equals("")) {
			pro.setName(projectName);
		}

		if (content != null && !content.equals("")) {
			pro.setContent(content);
		}

		if (duty != null && !duty.equals("")) {
			pro.setDuty(duty);
		}

		if (achieve == null || achieve.trim().equals("")) {
			pro.setAchieve(null);
		} else {
			pro.setAchieve(achieve);
		}
		pro.setAchieve(null);

		if (projectText != null && !projectText.equals("")) {
			pro.setInfo(projectText);
		}

		if (projectText != null && !projectText.equals("")) {
			pro.setProjectInfo(projectText);
		}

		if (company != null && !company.equals("")) {
			pro.setCompany(company);
		}

		return pro;

	}

	@Test
	public void testT() {
		System.out.println(timeStanderFormat("2016年5月19日"));
	}

	// 处理日期格式
	public String timeStanderFormat(String time) {
		String year = null, month = null;
		Pattern p = Pattern.compile("(\\d{4}).(\\d{1,2})");
		Matcher m = p.matcher(time);
		System.out.println(m.groupCount());
		if (m.find()) {
			System.out.println(m.group(1));
			System.out.println(m.group(2));
			year = m.group(1);
			month = m.group(2);

			if (month.length() < 2) {
				month = "0" + month;
			}
			return year + "-" + month;

		} else {
			if (time.indexOf("至今") != -1 || time.indexOf("目前") != -1 || time.indexOf("到现在") != -1
					|| time.indexOf("现在") != -1 || time.indexOf("今") != -1) {
				SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
				return sdf.format(new Date());
			}
		}
		return null;
	}

	/**
	 * 函数名：parseProject() 功 能：识别项目经历信息块的起止时间、公司、部门、职位、 项目职责、业绩、项目内容等
	 * 
	 * @throws IOException
	 */
	private void parseProject(String info, CVObject map, int[][] indexType, int flag) throws IOException {
		info = info.replaceAll("||    |||", "");
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<Project> pList = new ArrayList<Project>();
		if (map.getProjects() != null) {
			pList = map.getProjects();
		}
		// 处理包含年和月的情况
		Pattern pattern = Pattern.compile(
				"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}
		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i + 1) - iList.get(i) >= 15) {
				iList.set(i, info.length() * 2);
				i++;
			} else {
				i = i + 2;
			}
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i) == info.length() * 2) {
				iList.remove(i);
				sList.remove(i);
			} else {
				i++;
			}
		}

		if (iList.size() % 2 == 1) {
			iList.remove(iList.size() - 1);
			sList.remove(sList.size() - 1);
		}

		// 处理只有年份的情况
		if (iList.size() < 2) {
			Pattern pattern1 = Pattern.compile(
					"((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))|现在|至今|到现在|目前 ");
			Matcher matcher1 = pattern1.matcher(info);
			while (matcher1.find()) {
				String str = matcher1.group();
				sList.add(str);
				iList.add(matcher1.start());
			}

			for (Integer iListOne : iList) {
				// System.out.println(iListOne);
			}
			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i + 1) - iList.get(i) >= 15) {
					iList.set(i, info.length() * 2);
					i++;
				} else {
					i = i + 2;
				}
			}

			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i) == info.length() * 2) {
					iList.remove(i);
					sList.remove(i);
				} else {
					i++;
				}
			}

			if (iList.size() % 2 == 1) {
				iList.remove(iList.size() - 1);
				sList.remove(sList.size() - 1);
			}
		}

		int length = info.length();
		String project = "";
		Lexeme lex = null;
		String temp = "";
		int type = 0;
		int iCompany, iProject_name, iContent, iDuty, iAchieve, iCity;
		iCompany = iProject_name = iContent = iDuty = iAchieve = iCity = 0;
		boolean bCompany, bProject_name, bContent, bDuty, bAchieve, bCity;
		bCompany = bProject_name = bContent = bDuty = bAchieve = bCity = false;
		for (int i = 0, len = iList.size(); i < len;) {
			// System.out.println("project = " + project);
			if (iList.size() > 2) {
				if (i == 0) {
					String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
					project = info.substring(iList.get(0), iList.get(2));
					// System.out.println("project before = " + project);
					/// *
					pattern = Pattern.compile(
							"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
					matcher = pattern.matcher(project);
					int templocation = 0;
					int tempcount = 0;
					while (matcher.find()) {
						tempcount++;
						if (tempcount == 2) {
							templocation = matcher.end();
							break;
						}
					}
					project = project.substring(templocation, project.length());
					// */
					// System.out.println("project after = " + project);

					List<Integer> tempiList = new ArrayList<Integer>();
					List<String> tempsList = new ArrayList<String>();
					List<Medal> tempmList = new ArrayList<Medal>();
					pattern = Pattern.compile(
							"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
					matcher = pattern.matcher(project);
					int projectNameFlag = 0;
					while (matcher.find()) {
						String str = matcher.group();
						tempsList.add(str);
						tempiList.add(matcher.start());
						if (str.equals("项目名称") || str.equals("名称")) {
							projectNameFlag = 1;
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							// System.out.println(project.substring(tempiList.get(tempi),
							// project.length()));
						} else {
							// System.out.println(project.substring(tempiList.get(tempi),
							// tempiList.get(tempi+1)));
						}
					}
					Project projectinfo = new Project();
					String text = sList.get(i);
					projectinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					projectinfo.setEndTime(getStartTime(textSen));
					if (projectNameFlag == 0) {
						if (tempiList.size() == 0) {
							projectinfo.setInfo(project.substring(0, project.length()));
						} else {
							projectinfo.setInfo(project.substring(0, tempiList.get(0)));
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
							}
						} else {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo
										.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo
										.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							}
						}
					}

					/*
					 * StringReader sr = new StringReader(project); IKSegmenter
					 * ik = new IKSegmenter(sr, true); while ((lex = ik.next())
					 * != null) { iCompany--; iProject_name--; iContent--;
					 * iDuty--; iAchieve--; iCity--; temp = lex.getLexemeText();
					 * if (m_UserDic.containsKey(temp)) { type =
					 * m_UserDic.get(temp); switch (type) { case 208: //bCompany
					 * = true; //iCompany = 2; //bDuty = bProject_name =
					 * bAchieve = bContent = bCity = false; break; case 307:
					 * bProject_name = true; iProject_name = 2; bCompany =bDuty
					 * = bAchieve = bContent = bCity = false; break; case 306:
					 * bContent = true; iContent = 2; bProject_name =bCompany
					 * =bDuty = bAchieve = bCity = false; break; case 301: bDuty
					 * = true; iDuty = 2; bProject_name =bCompany =bAchieve =
					 * bContent = bCity = false; break; case 302: bAchieve =
					 * true; iAchieve = 2; bProject_name =bCompany =bDuty =
					 * bContent = bCity = false; break; case 203: bCity = true;
					 * iCity = 2; bProject_name =bCompany =bDuty = bAchieve =
					 * bContent = false; break; default: break; } } if (bCompany
					 * && (iCompany == 1)) { if(company.length()<=15) {
					 * company+=temp; iCompany = 2; }else{ bCompany = false; } }
					 * if ( bProject_name && (iProject_name == 1)) {
					 * if(company.length()<=15) { project_name+=temp;
					 * iProject_name = 2; }else{ bProject_name = false; } } if
					 * (bContent && (iContent == 1)) { content+=temp; iContent =
					 * 2; } if ( bDuty && (iDuty == 1)) { duty+=temp; iDuty = 2;
					 * } if (bAchieve && (iAchieve == 1)) { achieve+=temp;
					 * iAchieve = 2; } if (bCity && (iCity == 1)) {
					 * if(company.length()<=8) { city+=temp; iCity = 2; }else{
					 * bCity = false; } } } Project projectinfo = new Project();
					 * String text = sList.get(i);
					 * projectinfo.setStartTime(getStartTime(text)); String
					 * textSen = (i + 1)>=sList.size()?"":sList.get(i + 1);
					 * projectinfo.setEndTime(getStartTime(textSen));
					 * projectinfo.setCompany(company);
					 * projectinfo.setProjectName(project_name);
					 * projectinfo.setDuty(duty);
					 * projectinfo.setAchieve(achieve);
					 * projectinfo.setContent(content);
					 * projectinfo.setCity(city); //
					 * projectinfo.setInfo(project_name+" "+achieve + " " + duty
					 * + " "+ content);
					 * 
					 * //projectinfo.setInfo(info.trim());
					 * //projectinfo.setProjectInfo(info.trim());
					 * projectinfo.setInfo(project.trim());
					 * projectinfo.setProjectInfo(project.trim()); //
					 */

					// System.out.println("projectinfo" + projectinfo.toString()
					// );
					pList.add(projectinfo);
					projectinfo = null;
				} else if (i < len - 3) {
					String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
					project = info.substring(iList.get(i), iList.get(i + 2));
					// System.out.println("project before = " + project);
					/// *
					pattern = Pattern.compile(
							"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
					matcher = pattern.matcher(project);
					int templocation = 0;
					int tempcount = 0;
					while (matcher.find()) {
						// String str = matcher.group();
						// sList.add(str);
						// iList.add(matcher.start());
						tempcount++;
						if (tempcount == 2) {
							templocation = matcher.end();
							break;
						}
					}
					project = project.substring(templocation, project.length());
					// */
					// System.out.println("project after = " + project);

					List<Integer> tempiList = new ArrayList<Integer>();
					List<String> tempsList = new ArrayList<String>();
					List<Medal> tempmList = new ArrayList<Medal>();
					pattern = Pattern.compile(
							"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
					matcher = pattern.matcher(project);
					int projectNameFlag = 0;
					while (matcher.find()) {
						String str = matcher.group();
						tempsList.add(str);
						tempiList.add(matcher.start());
						if (str.equals("项目名称") || str.equals("名称")) {
							projectNameFlag = 1;
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							// System.out.println(project.substring(tempiList.get(tempi),
							// project.length()));
						} else {
							// System.out.println(project.substring(tempiList.get(tempi),
							// tempiList.get(tempi+1)));
						}
					}
					Project projectinfo = new Project();
					String text = sList.get(i);
					projectinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					projectinfo.setEndTime(getStartTime(textSen));
					if (projectNameFlag == 0) {
						if (tempiList.size() == 0) {
							projectinfo.setInfo(project.substring(0, project.length()));
						} else {
							projectinfo.setInfo(project.substring(0, tempiList.get(0)));
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
							}
						} else {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo
										.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo
										.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							}
						}
					}

					/*
					 * StringReader sr = new StringReader(project); IKSegmenter
					 * ik = new IKSegmenter(sr, true); while ((lex = ik.next())
					 * != null) { iCompany--; iProject_name--; iContent--;
					 * iDuty--; iAchieve--; iCity--; temp = lex.getLexemeText();
					 * if (m_UserDic.containsKey(temp)) { type =
					 * m_UserDic.get(temp); switch (type) { case 208: //bCompany
					 * = true; //iCompany = 2; //bDuty = bProject_name =
					 * bAchieve = bContent = bCity = false; break; case 307:
					 * bProject_name = true; iProject_name = 2; bCompany =bDuty
					 * = bAchieve = bContent = bCity = false; break; case 306:
					 * bContent = true; iContent = 2; bProject_name =bCompany
					 * =bDuty = bAchieve = bCity = false; break; case 301: bDuty
					 * = true; iDuty = 2; bProject_name =bCompany =bAchieve =
					 * bContent = bCity = false; break; case 302: bAchieve =
					 * true; iAchieve = 2; bProject_name =bCompany =bDuty =
					 * bContent = bCity = false; break; case 203: bCity = true;
					 * iCity = 2; bProject_name =bCompany =bDuty = bAchieve =
					 * bContent = false; break; default: break; } } if (bCompany
					 * && (iCompany == 1)) { if(company.length()<=15) {
					 * company+=temp; iCompany = 2; }else{ bCompany = false; } }
					 * if ( bProject_name && (iProject_name == 1)) {
					 * if(company.length()<=15) { project_name+=temp;
					 * iProject_name = 2; }else{ bProject_name = false; } } if
					 * (bContent && (iContent == 1)) { content+=temp; iContent =
					 * 2; } if ( bDuty && (iDuty == 1)) { duty+=temp; iDuty = 2;
					 * } if (bAchieve && (iAchieve == 1)) { achieve+=temp;
					 * iAchieve = 2; } if (bCity && (iCity == 1)) {
					 * if(company.length()<=8) { city+=temp; iCity = 2; }else{
					 * bCity = false; } } } Project projectinfo = new Project();
					 * String text = sList.get(i);
					 * projectinfo.setStartTime(getStartTime(text)); String
					 * textSen = (i + 1)>=sList.size()?"":sList.get(i + 1);
					 * projectinfo.setEndTime(getStartTime(textSen));
					 * projectinfo.setCompany(company);
					 * projectinfo.setProjectName(project_name);
					 * projectinfo.setDuty(duty);
					 * projectinfo.setAchieve(achieve);
					 * projectinfo.setContent(content);
					 * projectinfo.setCity(city); //
					 * projectinfo.setInfo(project_name+" "+achieve + " " + duty
					 * + " "+ content);
					 * 
					 * //projectinfo.setInfo(info.trim());
					 * //projectinfo.setProjectInfo(info.trim());
					 * projectinfo.setInfo(project.trim());
					 * projectinfo.setProjectInfo(project.trim());
					 * 
					 * //System.out.println("projectinfo" +
					 * projectinfo.toString() ); //
					 */
					pList.add(projectinfo);
					projectinfo = null;
				} else {
					String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
					project = info.substring(iList.get(i), length);
					// System.out.println("project before = " + project);
					/// *
					pattern = Pattern.compile(
							"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
					matcher = pattern.matcher(project);
					int templocation = 0;
					int tempcount = 0;
					while (matcher.find()) {
						// String str = matcher.group();
						// sList.add(str);
						// iList.add(matcher.start());
						tempcount++;
						if (tempcount == 2) {
							templocation = matcher.end();
							break;
						}
					}
					project = project.substring(templocation, project.length());
					// */
					// System.out.println("project after = " + project);

					List<Integer> tempiList = new ArrayList<Integer>();
					List<String> tempsList = new ArrayList<String>();
					List<Medal> tempmList = new ArrayList<Medal>();
					pattern = Pattern.compile(
							"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
					matcher = pattern.matcher(project);
					int projectNameFlag = 0;
					while (matcher.find()) {
						String str = matcher.group();
						tempsList.add(str);
						tempiList.add(matcher.start());
						if (str.equals("项目名称") || str.equals("名称")) {
							projectNameFlag = 1;
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							// System.out.println(project.substring(tempiList.get(tempi),
							// project.length()));
						} else {
							// System.out.println(project.substring(tempiList.get(tempi),
							// tempiList.get(tempi+1)));
						}
					}
					Project projectinfo = new Project();
					String text = sList.get(i);
					projectinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					projectinfo.setEndTime(getStartTime(textSen));
					if (projectNameFlag == 0) {
						if (tempiList.size() == 0) {
							projectinfo.setInfo(project.substring(0, project.length()));
						} else {
							projectinfo.setInfo(project.substring(0, tempiList.get(0)));
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
							}
						} else {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo
										.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo
										.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							}
						}
					}

					/*
					 * StringReader sr = new StringReader(project); IKSegmenter
					 * ik = new IKSegmenter(sr, true); while ((lex = ik.next())
					 * != null) { iCompany--; iProject_name--; iContent--;
					 * iDuty--; iAchieve--; iCity--; temp = lex.getLexemeText();
					 * if (m_UserDic.containsKey(temp)) { type =
					 * m_UserDic.get(temp); switch (type) { case 208: //bCompany
					 * = true; //iCompany = 2; //bDuty = bProject_name =
					 * bAchieve = bContent = bCity = false; break; case 307:
					 * bProject_name = true; iProject_name = 2; bCompany =bDuty
					 * = bAchieve = bContent = bCity = false; break; case 306:
					 * bContent = true; iContent = 2; bProject_name =bCompany
					 * =bDuty = bAchieve = bCity = false; break; case 301: bDuty
					 * = true; iDuty = 2; bProject_name =bCompany =bAchieve =
					 * bContent = bCity = false; break; case 302: bAchieve =
					 * true; iAchieve = 2; bProject_name =bCompany =bDuty =
					 * bContent = bCity = false; break; case 203: bCity = true;
					 * iCity = 2; bProject_name =bCompany =bDuty = bAchieve =
					 * bContent = false; break; default: break; } } if (bCompany
					 * && (iCompany == 1)) { if(company.length()<=15) {
					 * company+=temp; iCompany = 2; }else{ bCompany = false; } }
					 * if ( bProject_name && (iProject_name == 1)) {
					 * if(company.length()<=15) { project_name+=temp;
					 * iProject_name = 2; }else{ bProject_name = false; } } if
					 * (bContent && (iContent == 1)) { content+=temp; iContent =
					 * 2; } if ( bDuty && (iDuty == 1)) { duty+=temp; iDuty = 2;
					 * } if (bAchieve && (iAchieve == 1)) { achieve+=temp;
					 * iAchieve = 2; } if (bCity && (iCity == 1)) {
					 * if(company.length()<=8) { city+=temp; iCity = 2; }else{
					 * bCity = false; } } } Project projectinfo = new Project();
					 * String text = sList.get(i);
					 * projectinfo.setStartTime(getStartTime(text)); String
					 * textSen = (i + 1)>=sList.size()?"":sList.get(i + 1);
					 * projectinfo.setEndTime(getStartTime(textSen));
					 * projectinfo.setCompany(company);
					 * projectinfo.setProjectName(project_name);
					 * projectinfo.setDuty(duty);
					 * projectinfo.setAchieve(achieve);
					 * projectinfo.setContent(content);
					 * projectinfo.setCity(city);
					 * 
					 * //projectinfo.setInfo(info.trim());
					 * //projectinfo.setProjectInfo(info.trim());
					 * projectinfo.setInfo(project.trim());
					 * projectinfo.setProjectInfo(project.trim());
					 * 
					 * //System.out.println("projectinfo" +
					 * projectinfo.toString() ); //
					 */
					pList.add(projectinfo);
					projectinfo = null;
				}
			} else {
				String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
				project = info.substring(0, length);
				// System.out.println("project before = " + project);
				/// *
				pattern = Pattern.compile(
						"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
				matcher = pattern.matcher(project);
				int templocation = 0;
				int tempcount = 0;
				while (matcher.find()) {
					// String str = matcher.group();
					// sList.add(str);
					// iList.add(matcher.start());
					tempcount++;
					if (tempcount == 2) {
						templocation = matcher.end();
						break;
					}
				}
				project = project.substring(templocation, project.length());
				// */
				// System.out.println("project after = " + project);

				List<Integer> tempiList = new ArrayList<Integer>();
				List<String> tempsList = new ArrayList<String>();
				List<Medal> tempmList = new ArrayList<Medal>();
				pattern = Pattern.compile(
						"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
				matcher = pattern.matcher(project);
				int projectNameFlag = 0;
				while (matcher.find()) {
					String str = matcher.group();
					tempsList.add(str);
					tempiList.add(matcher.start());
					if (str.equals("项目名称") || str.equals("名称")) {
						projectNameFlag = 1;
					}
				}
				for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
					if (tempi >= templen - 1) {
						// System.out.println(project.substring(tempiList.get(tempi),
						// project.length()));
					} else {
						// System.out.println(project.substring(tempiList.get(tempi),
						// tempiList.get(tempi+1)));
					}
				}
				Project projectinfo = new Project();
				String text = sList.get(i);
				projectinfo.setStartTime(getStartTime(text));
				String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
				projectinfo.setEndTime(getStartTime(textSen));
				if (projectNameFlag == 0) {
					if (tempiList.size() == 0) {
						projectinfo.setInfo(project.substring(0, project.length()));
					} else {
						projectinfo.setInfo(project.substring(0, tempiList.get(0)));
					}
				}
				for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
					if (tempi >= templen - 1) {
						if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
							projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
						} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
								|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
							projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
						} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
								|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
								|| tempsList.get(tempi).equals("项目职责")) {
							projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
						}
					} else {
						if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
							projectinfo.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
						} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
								|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
							projectinfo.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
						} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
								|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
								|| tempsList.get(tempi).equals("项目职责")) {
							projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
						}
					}
				}

				/*
				 * StringReader sr = new StringReader(project); IKSegmenter ik =
				 * new IKSegmenter(sr, true); while ((lex = ik.next()) != null)
				 * { iCompany--; iProject_name--; iContent--; iDuty--;
				 * iAchieve--; iCity--; temp = lex.getLexemeText(); if
				 * (m_UserDic.containsKey(temp)) { type = m_UserDic.get(temp);
				 * switch (type) { case 208: //bCompany = true; //iCompany = 2;
				 * //bDuty = bProject_name = bAchieve = bContent = bCity =
				 * false; break; case 307: bProject_name = true; iProject_name =
				 * 2; bCompany =bDuty = bAchieve = bContent = bCity = false;
				 * break; case 306: bContent = true; iContent = 2; bProject_name
				 * =bCompany =bDuty = bAchieve = bCity = false; break; case 301:
				 * bDuty = true; iDuty = 2; bProject_name =bCompany =bAchieve =
				 * bContent = bCity = false; break; case 302: bAchieve = true;
				 * iAchieve = 2; bProject_name =bCompany =bDuty = bContent =
				 * bCity = false; break; case 203: bCity = true; iCity = 2;
				 * bProject_name =bCompany =bDuty = bAchieve = bContent = false;
				 * break; default: break; } } if (bCompany && (iCompany == 1)) {
				 * if(company.length()<=15) { company+=temp; iCompany = 2;
				 * }else{ bCompany = false; } } if ( bProject_name &&
				 * (iProject_name == 1)) { if(company.length()<=15) {
				 * project_name+=temp; iProject_name = 2; }else{ bProject_name =
				 * false; } } if (bContent && (iContent == 1)) { content+=temp;
				 * iContent = 2; } if ( bDuty && (iDuty == 1)) { duty+=temp;
				 * iDuty = 2; } if (bAchieve && (iAchieve == 1)) {
				 * achieve+=temp; iAchieve = 2; } if (bCity && (iCity == 1)) {
				 * if(company.length()<=8) { city+=temp; iCity = 2; }else{ bCity
				 * = false; } } } Project projectinfo = new Project(); String
				 * text = sList.get(i);
				 * projectinfo.setStartTime(getStartTime(text)); String textSen
				 * = (i + 1)>=sList.size()?"":sList.get(i + 1);
				 * projectinfo.setEndTime(getStartTime(textSen));
				 * projectinfo.setCompany(company);
				 * projectinfo.setProjectName(project_name);
				 * projectinfo.setDuty(duty); projectinfo.setAchieve(achieve);
				 * projectinfo.setContent(content); projectinfo.setCity(city);
				 * 
				 * //projectinfo.setInfo(info.trim());
				 * //projectinfo.setProjectInfo(info.trim());
				 * projectinfo.setInfo(project.trim());
				 * projectinfo.setProjectInfo(project.trim());
				 * 
				 * //System.out.println("projectinfo" + projectinfo.toString()
				 * ); //
				 */
				pList.add(projectinfo);
				projectinfo = null;
			}
			i += 2;
		}

		if (iList.size() <= 0) {
			String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
			project = info.substring(0, length);
			// System.out.println("project before = " + project);
			/// *
			pattern = Pattern.compile(
					"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
			matcher = pattern.matcher(project);
			int templocation = 0;
			int tempcount = 0;
			while (matcher.find()) {
				// String str = matcher.group();
				// sList.add(str);
				// iList.add(matcher.start());
				tempcount++;
				if (tempcount == 2) {
					templocation = matcher.end();
					break;
				}
			}
			project = project.substring(templocation, project.length());
			// */
			// System.out.println("project after = " + project);

			List<Integer> tempiList = new ArrayList<Integer>();
			List<String> tempsList = new ArrayList<String>();
			List<Medal> tempmList = new ArrayList<Medal>();
			pattern = Pattern.compile(
					"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
			matcher = pattern.matcher(project);
			int projectNameFlag = 0;
			while (matcher.find()) {
				String str = matcher.group();
				tempsList.add(str);
				tempiList.add(matcher.start());
				if (str.equals("项目名称") || str.equals("名称")) {
					projectNameFlag = 1;
				}
			}
			for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
				if (tempi >= templen - 1) {
					// System.out.println(project.substring(tempiList.get(tempi),
					// project.length()));
				} else {
					// System.out.println(project.substring(tempiList.get(tempi),
					// tempiList.get(tempi+1)));
				}
			}
			Project projectinfo = new Project();
			if (projectNameFlag == 0) {
				if (tempiList.size() == 0) {
					projectinfo.setInfo(project.substring(0, project.length()));
				} else {
					projectinfo.setInfo(project.substring(0, tempiList.get(0)));
				}
			}
			for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
				if (tempi >= templen - 1) {
					if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
						projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
					} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
							|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
						projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
					} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
							|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
							|| tempsList.get(tempi).equals("项目职责")) {
						projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
					}
				} else {
					if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
						projectinfo.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
					} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
							|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
						projectinfo.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
					} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
							|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
							|| tempsList.get(tempi).equals("项目职责")) {
						projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
					}
				}
			}
			projectinfo.setStartTime("0000-01-01");
			projectinfo.setEndTime("0000-01-01");
			pList.add(projectinfo);
			projectinfo = null;
		}

		map.setProjects(pList);
		iList = null;
		sList = null;
		pList = null;
		if (flag == 1) {
			for (int i = 0; i < 11; i++) {
				if (indexType[0][i] == 0) {
					switch (indexType[1][i]) {
					case 0:
						parseBasic(info, map, indexType, 0);
						if (map.getBasic().getName() == null || map.getBasic().getName().equals("")) {
							// detectName(content,map);
						}
						break;
					case 1:
						// parseEducation(info,map,indexType,0);
						break;
					case 2:
						// parseJob(info,map,indexType,0);
						break;
					case 3:
						// parseProject(info,map,indexType,0);
						break;
					case 4:
						// parseMedal(info,map,indexType,0);
						break;
					case 5:
						// parseSkill(info,map,indexType,0);
						break;
					case 6:
						// parsePaper(info,map,indexType,0);
						break;
					case 7:
						// parsePatent(info,map,indexType,0);
						break;
					case 8:
						// parseComment(info,map,indexType,0);
						break;
					case 9:
						// parseExpectation(info,map,indexType,0);
						break;
					case 10:
						// parseOther(info,map,indexType,0);
						break;
					default:
						break;
					}
				}
			}
		}
	}

	// 无用
	private String getStartTime(String text) {
		Pattern pyear = Pattern.compile("\\d{4}");
		Pattern pMonth = Pattern.compile("\\d{2}");
		Pattern pDay = Pattern.compile("\\d{1}");
		Matcher matcherYear = pyear.matcher(text);
		String year = "0000", month = "01", day = "01";
		while (matcherYear.find()) {
			year = matcherYear.group();
			break;
		}
		String text1 = text.replaceFirst(year, "");
		Matcher matcherMon = pMonth.matcher(text1);
		if (matcherMon.find()) {
			month = matcherMon.group();
		} else {
			Matcher matcherDay = pDay.matcher(text1);
			while (matcherDay.find()) {
				month = matcherDay.group();
				month = "0" + month;
				break;
			}
		}

		if (text.indexOf("至今") != -1 || text.indexOf("目前") != -1 || text.indexOf("到现在") != -1
				|| text.indexOf("现在") != -1 || text.indexOf("今") != -1) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
			return sdf.format(new Date());
		}

		// return year + "-" + month + "-" + day;
		return year + "-" + month;
	}

	private String getStartTimeMedal(String text) {
		Pattern pyear = Pattern.compile("\\d{4}");
		Pattern pMonth = Pattern.compile("\\d{2}");
		Pattern pDay = Pattern.compile("\\d{1}");
		Matcher matcherYear = pyear.matcher(text);
		String year = "0000", month = "01", day = "01";
		while (matcherYear.find()) {
			year = matcherYear.group();
			break;
		}
		/*
		 * String text1 = text.replaceFirst(year, ""); Matcher matcherMon =
		 * pMonth.matcher(text1); if(matcherMon.find()) { month =
		 * matcherMon.group(); }else { Matcher matcherDay = pDay.matcher(text1);
		 * while(matcherDay.find()) { month = matcherDay.group(); month =
		 * "0"+month; break; } }
		 */
		return year + "-" + month + "-" + day;
	}

	/**
	 * 函数名：parseJob() * 功 能：识别工作经历信息块的起止时间、公司、部门、职位、 汇报对象、工作地点、工作职责、业绩、离职原因等。
	 * 
	 * @throws IOException
	 * 
	 */

	private void parseJob(String info, CVObject map, int[][] indexType, int flag) throws IOException {

		info = info.replaceAll("||    |||", "");// 去掉不规则字符
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<Job> jList = new ArrayList<Job>();
		if (map.getJobs() != null) {
			jList = map.getJobs();
		}
		Pattern pattern = Pattern.compile( //
				"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
						+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
						+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
						+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
						+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
						+ "((19\\d{2}|20\\d{2})\\s*年)|" //
						+ "((19\\d{2}|20\\d{2}))"); //
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());// 时间位置
		}
		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}
		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i + 1) - iList.get(i) >= 10) {
				iList.set(i, info.length() * 2);
				i++;
			} else {
				i = i + 2;
			}
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i) == info.length() * 2) {
				iList.remove(i);
				sList.remove(i);
			} else {
				i++;
			}
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}

		if (iList.size() % 2 == 1) {
			iList.remove(iList.size() - 1);
			sList.remove(sList.size() - 1);
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}

		// 处理只有年份的情况
		if (iList.size() < 2) {
			Pattern pattern1 = Pattern.compile(
					"((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))|现在|至今|到现在|目前 |今 ");
			Matcher matcher1 = pattern1.matcher(info);
			while (matcher1.find()) {
				String str = matcher1.group();
				sList.add(str);
				iList.add(matcher1.start());
			}

			for (Integer iListOne : iList) {
				// System.out.println(iListOne);
			}
			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i + 1) - iList.get(i) >= 15) {
					iList.set(i, info.length() * 2);
					i++;
				} else {
					i = i + 2;
				}
			}

			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i) == info.length() * 2) {
					iList.remove(i);
					sList.remove(i);
				} else {
					i++;
				}
			}

			if (iList.size() % 2 == 1) {
				iList.remove(iList.size() - 1);
				sList.remove(sList.size() - 1);
			}
		}

		int length = info.length();
		String job = "";
		Lexeme lex = null;
		String temp = "";
		int type = 0;
		int iCompany, iTitle, iReport, iMember, iDuty, iOther, iAchieve, iReason, iCity, iDepartment;
		boolean bCompany, bTitle, bReport, bMember, bDuty, bOther, bAchieve, bReason, bCity, bDepartment;
		for (int i = 0, len = iList.size(); i < len;) {
			if (iList.size() > 2) {
				if (i == 0) {
					iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther = iAchieve = iReason = iCity = 0;
					bDepartment = bCompany = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
					StringBuffer sCompany = new StringBuffer();
					StringBuffer sTitle = new StringBuffer();
					StringBuffer sReport = new StringBuffer();
					StringBuffer sMember = new StringBuffer();
					StringBuffer sDuty = new StringBuffer();
					StringBuffer sOther = new StringBuffer();
					StringBuffer sAchieve = new StringBuffer();
					StringBuffer sReason = new StringBuffer();
					StringBuffer sCity = new StringBuffer();
					StringBuffer sDepartment = new StringBuffer();
					job = info.substring(iList.get(i), iList.get(i + 2));
					StringReader sr = new StringReader(job);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iDepartment--;
						iCompany--;
						iTitle--;
						iReport--;
						iMember--;
						iDuty--;
						iOther--;
						iAchieve--;
						iReason--;
						iCity--;
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							/*
							 * case 208: bCompany = true; iCompany = 2;
							 * bDepartment =bTitle = bReport = bMember = bDuty =
							 * bOther = bAchieve = bReason = bCity = false;
							 * break; //
							 */
							case 15:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 3:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							/*
							 * case 209: bTitle = true; iTitle = 2; bDepartment
							 * =bCompany = bReport = bMember = bDuty = bOther =
							 * bAchieve = bReason = bCity = false; break; //
							 */
							case 14:
								bTitle = true;
								iTitle = 3;
								bDepartment = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 300:
								bMember = true;
								iMember = 2;
								bDepartment = bTitle = bCompany = bReport = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 301:
								bDuty = true;
								iDuty = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bOther = bAchieve = bReason = bCity = false;
								break;
							case 302:
								bAchieve = true;
								iAchieve = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bReason = bCity = false;
								break;
							case 303:
								bReason = true;
								iReason = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bCity = false;
								break;
							case 304:
								bCity = true;
								iCity = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = false;
								break;
							case 306:
								bReport = true;
								iReport = 2;
								bDepartment = bTitle = bCompany = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 307:
								bOther = true;
								iOther = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							case 308:
								bDepartment = true;
								iDepartment = 2;
								bOther = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							default:
								break;
							}
						}
						if (bDepartment && (iDepartment == 1)) {
							if (sDepartment.length() <= 10) {
								sDepartment.append(temp);
								iDepartment = 2;
							} else {
								bDepartment = false;
							}
						}
						if (bCompany && (iCompany == 1)) {
							if (sCompany.length() <= 15) {
								sCompany.append(temp);
								iCompany = 2;
							} else {
								bCompany = false;
							}
						}
						if (bCompany && (iCompany == 3)) {
							if (sCompany.length() == 0) {
								sCompany.append(temp);
								iCompany = 0;
								bCompany = false;
							}
						}
						/*
						 * if (bTitle && (iTitle == 1)) {
						 * if(sTitle.length()<=10) { sTitle.append(temp); iTitle
						 * = 2; }else{ bTitle = false; } } //
						 */
						if (bTitle && (iTitle == 3)) {
							// System.out.println("find title");
							if (sTitle.length() == 0) {
								// System.out.println("add title");
								sTitle.append(temp);
								iTitle = 0;
								bTitle = false;
							}
						}
						if (bReport && (iReport == 1)) {
							sReport.append(temp);
							iReport = 2;
						}
						if (bMember && (iMember == 1)) {
							sMember.append(temp);
							iMember = 2;
						}
						if (bDuty && (iDuty == 1)) {
							sDuty.append(temp);
							iDuty = 2;
						}
						if (bOther && (iOther == 1)) {
							sOther.append(temp);
							iOther = 2;
						}
						if (bAchieve && (iAchieve == 1)) {
							sAchieve.append(temp);
							iAchieve = 2;
						}
						if (bReason && (iReason == 1)) {
							sReason.append(temp);
							iReason = 2;
						}
						if (bCity && (iCity == 1)) {
							if (sCity.length() <= 8) {
								sCity.append(temp);
								iCity = 2;
							} else {
								bCity = false;
							}
						}
					}
					Job jobinfo = new Job();
					String text = sList.get(i);
					jobinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					jobinfo.setEndTime(getStartTime(textSen));
					jobinfo.setAchieve(sAchieve.toString());
					jobinfo.setCity(sCity.toString());
					jobinfo.setCompany(sCompany.toString());
					if (jobinfo.getCompany().length() > 50) {
						jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
					}
					jobinfo.setDuty(sDuty.toString());
					jobinfo.setDepartment(sDepartment.toString());
					jobinfo.setReport(sReport.toString());
					jobinfo.setReason(sReason.toString());
					jobinfo.setMember(sMember.toString());
					jobinfo.setTitle(sTitle.toString());
					if (jobinfo.getTitle().length() > 12) {
						jobinfo.setTitle(jobinfo.getTitle().substring(0, 11));
					}
					jobinfo.setInfo(
							sDepartment.toString() + sReport.toString() + sDuty.toString() + sReason.toString());
					// 工作描述
					if (jobinfo.getInfo() != null && !jobinfo.getInfo().trim().equals("")) {
						jobinfo.setDuty(jobinfo.getInfo());
					}
					// jobinfo.setJobInfo(info.trim());
					if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
						String tempjob = job;
						Pattern pattern1 = Pattern.compile( //
								"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
										+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
										+ "((19\\d{2}|20\\d{2})\\s*年)|" //
										+ "((19\\d{2}|20\\d{2}))");
						Matcher matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							String str = matcher1.group();
							tempjob = tempjob.replaceAll(str, "");
							// tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—",
							// "");
						}
						// System.out.println("tempjob = " + tempjob);
						tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
						// System.out.println("tempjob = " + tempjob);
						tempjob = tempjob.replaceFirst("至", "");
						pattern1 = Pattern.compile("股份有限公司|有限责任公司|有限公司");
						matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							jobinfo.setCompany(tempjob.substring(0, matcher1.start()) + matcher1.group());
							break;
						}
						if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
							if (jobinfo.getTitle() == null || jobinfo.getTitle().equals("")) {
								/*
								 * List<Integer> iList1 = new
								 * ArrayList<Integer>(); List<String> sList1 =
								 * new ArrayList<String>(); String tempjob =
								 * job; Pattern pattern1 = Pattern .compile(
								 * "((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 |((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))"
								 * ); Matcher matcher1 =
								 * pattern1.matcher(tempjob); while
								 * (matcher1.find()) { String str =
								 * matcher1.group(); tempjob =
								 * tempjob.replaceAll(str, ""); //tempjob =
								 * tempjob.replaceAll("-|\\/|\\|\\.|—", ""); }
								 * //System.out.println("tempjob = " + tempjob);
								 * tempjob =
								 * tempjob.replaceAll("-|\\/|\\|\\.|—|–", "");
								 * //System.out.println("tempjob = " + tempjob);
								 * tempjob = tempjob.replaceFirst("至", "");
								 * pattern1 = Pattern
								 * .compile("股份有限公司|有限责任公司|有限公司"); matcher1 =
								 * pattern1.matcher(tempjob); while
								 * (matcher1.find()) { System.out.println(
								 * "company = " + matcher1.group());
								 * System.out.println("sub = " +
								 * tempjob.substring(0, matcher1.start()) +
								 * matcher1.group());
								 * jobinfo.setCompany(tempjob.substring(0,
								 * matcher1.start()) + matcher1.group()); break;
								 * } //
								 */
							} else {
								List<Integer> iList1 = new ArrayList<Integer>();
								List<String> sList1 = new ArrayList<String>();
								tempjob = job;
								pattern1 = Pattern.compile( //
										"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
												+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
												+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
												+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
												+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
												+ "((19\\d{2}|20\\d{2})\\s*年)|" //
												+ "((19\\d{2}|20\\d{2}))");
								matcher1 = pattern1.matcher(tempjob);
								while (matcher1.find()) {
									String str = matcher1.group();
									tempjob = tempjob.replaceAll(str, "");
									// tempjob =
									// tempjob.replaceAll("-|\\/|\\|\\.|—", "");
								}
								// System.out.println("tempjob = " + tempjob);
								tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
								// System.out.println("tempjob = " + tempjob);
								tempjob = tempjob.replaceFirst("至", "");
								pattern1 = Pattern.compile(jobinfo.getTitle());
								matcher1 = pattern1.matcher(tempjob);
								while (matcher1.find()) {
									jobinfo.setCompany(tempjob.substring(0, matcher1.start()));
									if (jobinfo.getCompany().length() > 50) {
										jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
									}
									break;
								}
							}
						}
					}
					jList.add(jobinfo);
					sDepartment = sAchieve = sCity = sCompany = sDuty = sMember = sReport = sReason = sMember = sTitle = null;
					jobinfo = null;
				} else if (i < len - 3) {
					iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther = iAchieve = iReason = iCity = 0;
					bDepartment = bCompany = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
					StringBuffer sCompany = new StringBuffer();
					StringBuffer sTitle = new StringBuffer();
					StringBuffer sReport = new StringBuffer();
					StringBuffer sMember = new StringBuffer();
					StringBuffer sDuty = new StringBuffer();
					StringBuffer sOther = new StringBuffer();
					StringBuffer sAchieve = new StringBuffer();
					StringBuffer sReason = new StringBuffer();
					StringBuffer sCity = new StringBuffer();
					StringBuffer sDepartment = new StringBuffer();
					job = info.substring(iList.get(i), iList.get(i + 2));
					StringReader sr = new StringReader(job);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iDepartment--;
						iCompany--;
						iTitle--;
						iReport--;
						iMember--;
						iDuty--;
						iOther--;
						iAchieve--;
						iReason--;
						iCity--;
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							/*
							 * case 208: bCompany = true; iCompany = 2;
							 * bDepartment =bTitle = bReport = bMember = bDuty =
							 * bOther = bAchieve = bReason = bCity = false;
							 * break; //
							 */
							case 15:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 3:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							/*
							 * case 209: bTitle = true; iTitle = 2; bDepartment
							 * =bCompany = bReport = bMember = bDuty = bOther =
							 * bAchieve = bReason = bCity = false; break; //
							 */
							case 14:
								bTitle = true;
								iTitle = 3;
								bDepartment = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 300:
								bMember = true;
								iMember = 2;
								bDepartment = bTitle = bCompany = bReport = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 301:
								bDuty = true;
								iDuty = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bOther = bAchieve = bReason = bCity = false;
								break;
							case 302:
								bAchieve = true;
								iAchieve = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bReason = bCity = false;
								break;
							case 303:
								bReason = true;
								iReason = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bCity = false;
								break;
							case 304:
								bCity = true;
								iCity = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = false;
								break;
							case 306:
								bReport = true;
								iReport = 2;
								bDepartment = bTitle = bCompany = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 307:
								bOther = true;
								iOther = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							case 308:
								bDepartment = true;
								iDepartment = 2;
								bOther = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							default:
								break;
							}
						}
						if (bDepartment && (iDepartment == 1)) {
							if (sDepartment.length() <= 10) {
								sDepartment.append(temp);
								iDepartment = 2;
							} else {
								bDepartment = false;
							}
						}
						if (bCompany && (iCompany == 1)) {
							if (sCompany.length() <= 15) {
								sCompany.append(temp);
								iCompany = 2;
							} else {
								bCompany = false;
							}
						}
						if (bCompany && (iCompany == 3)) {
							if (sCompany.length() == 0) {
								sCompany.append(temp);
								iCompany = 0;
								bCompany = false;
							}
						}
						/*
						 * if (bTitle && (iTitle == 1)) {
						 * if(sTitle.length()<=10) { sTitle.append(temp); iTitle
						 * = 2; }else{ bTitle = false; } } //
						 */
						if (bTitle && (iTitle == 3)) {
							// System.out.println("find title");
							if (sTitle.length() == 0) {
								// System.out.println("add title");
								sTitle.append(temp);
								iTitle = 0;
								bTitle = false;
							}
						}
						if (bReport && (iReport == 1)) {
							sReport.append(temp);
							iReport = 2;
						}
						if (bMember && (iMember == 1)) {
							sMember.append(temp);
							iMember = 2;
						}
						if (bDuty && (iDuty == 1)) {
							sDuty.append(temp);
							iDuty = 2;
						}
						if (bOther && (iOther == 1)) {
							sOther.append(temp);
							iOther = 2;
						}
						if (bAchieve && (iAchieve == 1)) {
							sAchieve.append(temp);
							iAchieve = 2;
						}
						if (bReason && (iReason == 1)) {
							sReason.append(temp);
							iReason = 2;
						}
						if (bCity && (iCity == 1)) {
							if (sCity.length() <= 8) {
								sCity.append(temp);
								iCity = 2;
							} else {
								bCity = false;
							}
						}

					}
					Job jobinfo = new Job();
					String text = sList.get(i);
					jobinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					jobinfo.setEndTime(getStartTime(textSen));
					jobinfo.setAchieve(sAchieve.toString());
					jobinfo.setCity(sCity.toString());
					jobinfo.setCompany(sCompany.toString());
					if (jobinfo.getCompany().length() > 50) {
						jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
					}
					jobinfo.setDuty(sDuty.toString());
					jobinfo.setDepartment(sDepartment.toString());
					jobinfo.setReport(sReport.toString());
					jobinfo.setReason(sReason.toString());
					jobinfo.setMember(sMember.toString());
					jobinfo.setTitle(sTitle.toString());
					if (jobinfo.getTitle().length() > 12) {
						jobinfo.setTitle(jobinfo.getTitle().substring(0, 11));
					}
					jobinfo.setInfo(
							sDepartment.toString() + sReport.toString() + sDuty.toString() + sReason.toString());
					if (jobinfo.getInfo() != null && !jobinfo.getInfo().trim().equals("")) {
						jobinfo.setDuty(jobinfo.getInfo());
					}
					// jobinfo.setJobInfo(info.trim());

					if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
						String tempjob = job;
						Pattern pattern1 = Pattern.compile( //
								"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
										+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
										+ "((19\\d{2}|20\\d{2})\\s*年)|" //
										+ "((19\\d{2}|20\\d{2}))");
						Matcher matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							String str = matcher1.group();
							tempjob = tempjob.replaceAll(str, "");
							// tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—",
							// "");
						}
						// System.out.println("tempjob = " + tempjob);
						tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
						// System.out.println("tempjob = " + tempjob);
						tempjob = tempjob.replaceFirst("至", "");
						pattern1 = Pattern.compile("股份有限公司|有限责任公司|有限公司");
						matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							jobinfo.setCompany(tempjob.substring(0, matcher1.start()) + matcher1.group());
							break;
						}
						if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
							if (jobinfo.getTitle() == null || jobinfo.getTitle().equals("")) {
								/*
								 * List<Integer> iList1 = new
								 * ArrayList<Integer>(); List<String> sList1 =
								 * new ArrayList<String>(); String tempjob =
								 * job; Pattern pattern1 = Pattern .compile(
								 * "((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 |((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))"
								 * ); Matcher matcher1 =
								 * pattern1.matcher(tempjob); while
								 * (matcher1.find()) { String str =
								 * matcher1.group(); tempjob =
								 * tempjob.replaceAll(str, ""); //tempjob =
								 * tempjob.replaceAll("-|\\/|\\|\\.|—", ""); }
								 * //System.out.println("tempjob = " + tempjob);
								 * tempjob =
								 * tempjob.replaceAll("-|\\/|\\|\\.|—|–", "");
								 * //System.out.println("tempjob = " + tempjob);
								 * tempjob = tempjob.replaceFirst("至", "");
								 * pattern1 = Pattern
								 * .compile("股份有限公司|有限责任公司|有限公司"); matcher1 =
								 * pattern1.matcher(tempjob); while
								 * (matcher1.find()) { System.out.println(
								 * "company = " + matcher1.group());
								 * System.out.println("sub = " +
								 * tempjob.substring(0, matcher1.start()) +
								 * matcher1.group());
								 * jobinfo.setCompany(tempjob.substring(0,
								 * matcher1.start()) + matcher1.group()); break;
								 * } //
								 */
							} else {
								List<Integer> iList1 = new ArrayList<Integer>();
								List<String> sList1 = new ArrayList<String>();
								tempjob = job;
								pattern1 = Pattern.compile( //
										"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
												+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
												+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
												+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
												+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
												+ "((19\\d{2}|20\\d{2})\\s*年)|" //
												+ "((19\\d{2}|20\\d{2}))");
								matcher1 = pattern1.matcher(tempjob);
								while (matcher1.find()) {
									String str = matcher1.group();
									tempjob = tempjob.replaceAll(str, "");
									// tempjob =
									// tempjob.replaceAll("-|\\/|\\|\\.|—", "");
								}
								// System.out.println("tempjob = " + tempjob);
								tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
								// System.out.println("tempjob = " + tempjob);
								tempjob = tempjob.replaceFirst("至", "");
								pattern1 = Pattern.compile(jobinfo.getTitle());
								matcher1 = pattern1.matcher(tempjob);
								while (matcher1.find()) {
									jobinfo.setCompany(tempjob.substring(0, matcher1.start()));
									if (jobinfo.getCompany().length() > 50) {
										jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
									}
									break;
								}
							}
						}
					}
					jList.add(jobinfo);
					sDepartment = sAchieve = sCity = sCompany = sDuty = sMember = sReport = sReason = sMember = sTitle = null;
					jobinfo = null;
				} else {
					iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther = iAchieve = iReason = iCity = 0;
					bDepartment = bCompany = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
					StringBuffer sCompany = new StringBuffer();
					StringBuffer sTitle = new StringBuffer();
					StringBuffer sReport = new StringBuffer();
					StringBuffer sMember = new StringBuffer();
					StringBuffer sDuty = new StringBuffer();
					StringBuffer sOther = new StringBuffer();
					StringBuffer sAchieve = new StringBuffer();
					StringBuffer sReason = new StringBuffer();
					StringBuffer sCity = new StringBuffer();
					StringBuffer sDepartment = new StringBuffer();
					job = info.substring(iList.get(i), length);
					StringReader sr = new StringReader(job);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iDepartment--;
						iCompany--;
						iTitle--;
						iReport--;
						iMember--;
						iDuty--;
						iOther--;
						iAchieve--;
						iReason--;
						iCity--;
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							/*
							 * case 208: bCompany = true; iCompany = 2;
							 * bDepartment =bTitle = bReport = bMember = bDuty =
							 * bOther = bAchieve = bReason = bCity = false;
							 * break; //
							 */
							case 15:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 3:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							/*
							 * case 209: bTitle = true; iTitle = 2; bDepartment
							 * =bCompany = bReport = bMember = bDuty = bOther =
							 * bAchieve = bReason = bCity = false; break; //
							 */
							case 14:
								bTitle = true;
								iTitle = 3;
								bDepartment = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 300:
								bMember = true;
								iMember = 2;
								bDepartment = bTitle = bCompany = bReport = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 301:
								bDuty = true;
								iDuty = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bOther = bAchieve = bReason = bCity = false;
								break;
							case 302:
								bAchieve = true;
								iAchieve = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bReason = bCity = false;
								break;
							case 303:
								bReason = true;
								iReason = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bCity = false;
								break;
							case 304:
								bCity = true;
								iCity = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = false;
								break;
							case 306:
								bReport = true;
								iReport = 2;
								bDepartment = bTitle = bCompany = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 307:
								bOther = true;
								iOther = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							case 308:
								bDepartment = true;
								iDepartment = 2;
								bOther = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							default:
								break;
							}
						}
						if (bDepartment && (iDepartment == 1)) {
							if (sDepartment.length() <= 10) {
								sDepartment.append(temp);
								iDepartment = 2;
							} else {
								bDepartment = false;
							}
						}
						if (bCompany && (iCompany == 1)) {
							if (sCompany.length() <= 15) {
								sCompany.append(temp);
								iCompany = 2;
							} else {
								bCompany = false;
							}
						}
						if (bCompany && (iCompany == 3)) {
							if (sCompany.length() == 0) {
								sCompany.append(temp);
								iCompany = 0;
								bCompany = false;
							}
						}
						/*
						 * if (bTitle && (iTitle == 1)) {
						 * if(sTitle.length()<=10) { sTitle.append(temp); iTitle
						 * = 2; }else{ bTitle = false; } } //
						 */
						if (bTitle && (iTitle == 3)) {
							// System.out.println("find title");
							if (sTitle.length() == 0) {
								// System.out.println("add title");
								sTitle.append(temp);
								iTitle = 0;
								bTitle = false;
							}
						}
						if (bReport && (iReport == 1)) {
							sReport.append(temp);
							iReport = 2;
						}
						if (bMember && (iMember == 1)) {
							sMember.append(temp);
							iMember = 2;
						}
						if (bDuty && (iDuty == 1)) {
							sDuty.append(temp);
							iDuty = 2;
						}
						if (bOther && (iOther == 1)) {
							sOther.append(temp);
							iOther = 2;
						}
						if (bAchieve && (iAchieve == 1)) {
							sAchieve.append(temp);
							iAchieve = 2;
						}
						if (bReason && (iReason == 1)) {
							sReason.append(temp);
							iReason = 2;
						}
						if (bCity && (iCity == 1)) {
							if (sCity.length() <= 8) {
								sCity.append(temp);
								iCity = 2;
							} else {
								bCity = false;
							}
						}
					}
					Job jobinfo = new Job();
					String text = sList.get(i);
					jobinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					jobinfo.setEndTime(getStartTime(textSen));
					jobinfo.setAchieve(sAchieve.toString());
					jobinfo.setCity(sCity.toString());
					jobinfo.setCompany(sCompany.toString());
					if (jobinfo.getCompany().length() > 50) {
						jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
					}
					jobinfo.setDuty(sDuty.toString());
					jobinfo.setDepartment(sDepartment.toString());
					jobinfo.setReport(sReport.toString());
					jobinfo.setReason(sReason.toString());
					jobinfo.setMember(sMember.toString());
					jobinfo.setTitle(sTitle.toString());
					if (jobinfo.getTitle().length() > 12) {
						jobinfo.setTitle(jobinfo.getTitle().substring(0, 11));
					}
					jobinfo.setInfo(
							sDepartment.toString() + sReport.toString() + sDuty.toString() + sReason.toString());
					if (jobinfo.getInfo() != null && !jobinfo.getInfo().trim().equals("")) {
						jobinfo.setDuty(jobinfo.getInfo());
					}
					// jobinfo.setJobInfo(info.trim());
					// System.out.println("jobinfo" + jobinfo.toString() );
					if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
						String tempjob = job;
						Pattern pattern1 = Pattern.compile( //
								"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
										+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
										+ "((19\\d{2}|20\\d{2})\\s*年)|" //
										+ "((19\\d{2}|20\\d{2}))");
						Matcher matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							String str = matcher1.group();
							tempjob = tempjob.replaceAll(str, "");
							// tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—",
							// "");
						}
						// System.out.println("tempjob = " + tempjob);
						tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
						// System.out.println("tempjob = " + tempjob);
						tempjob = tempjob.replaceFirst("至", "");
						pattern1 = Pattern.compile("股份有限公司|有限责任公司|有限公司");
						matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							jobinfo.setCompany(tempjob.substring(0, matcher1.start()) + matcher1.group());
							break;
						}
						if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
							if (jobinfo.getTitle() == null || jobinfo.getTitle().equals("")) {
								/*
								 * List<Integer> iList1 = new
								 * ArrayList<Integer>(); List<String> sList1 =
								 * new ArrayList<String>(); String tempjob =
								 * job; Pattern pattern1 = Pattern .compile(
								 * "((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 |((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))"
								 * ); Matcher matcher1 =
								 * pattern1.matcher(tempjob); while
								 * (matcher1.find()) { String str =
								 * matcher1.group(); tempjob =
								 * tempjob.replaceAll(str, ""); //tempjob =
								 * tempjob.replaceAll("-|\\/|\\|\\.|—", ""); }
								 * //System.out.println("tempjob = " + tempjob);
								 * tempjob =
								 * tempjob.replaceAll("-|\\/|\\|\\.|—|–", "");
								 * //System.out.println("tempjob = " + tempjob);
								 * tempjob = tempjob.replaceFirst("至", "");
								 * pattern1 = Pattern
								 * .compile("股份有限公司|有限责任公司|有限公司"); matcher1 =
								 * pattern1.matcher(tempjob); while
								 * (matcher1.find()) { System.out.println(
								 * "company = " + matcher1.group());
								 * System.out.println("sub = " +
								 * tempjob.substring(0, matcher1.start()) +
								 * matcher1.group());
								 * jobinfo.setCompany(tempjob.substring(0,
								 * matcher1.start()) + matcher1.group()); break;
								 * } //
								 */
							} else {
								List<Integer> iList1 = new ArrayList<Integer>();
								List<String> sList1 = new ArrayList<String>();
								tempjob = job;
								pattern1 = Pattern.compile( //
										"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
												+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
												+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
												+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
												+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
												+ "((19\\d{2}|20\\d{2})\\s*年)|" //
												+ "((19\\d{2}|20\\d{2}))");
								matcher1 = pattern1.matcher(tempjob);
								while (matcher1.find()) {
									String str = matcher1.group();
									tempjob = tempjob.replaceAll(str, "");
									// tempjob =
									// tempjob.replaceAll("-|\\/|\\|\\.|—", "");
								}
								// System.out.println("tempjob = " + tempjob);
								tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
								// System.out.println("tempjob = " + tempjob);
								tempjob = tempjob.replaceFirst("至", "");
								pattern1 = Pattern.compile(jobinfo.getTitle());
								matcher1 = pattern1.matcher(tempjob);
								while (matcher1.find()) {
									jobinfo.setCompany(tempjob.substring(0, matcher1.start()));
									if (jobinfo.getCompany().length() > 50) {
										jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
									}
									break;
								}
							}
						}
					}
					jList.add(jobinfo);
					sDepartment = sAchieve = sCity = sCompany = sDuty = sMember = sReport = sReason = sMember = sTitle = null;
					jobinfo = null;
				}
			} else {
				iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther = iAchieve = iReason = iCity = 0;
				bDepartment = bCompany = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
				StringBuffer sCompany = new StringBuffer();
				StringBuffer sTitle = new StringBuffer();
				StringBuffer sReport = new StringBuffer();
				StringBuffer sMember = new StringBuffer();
				StringBuffer sDuty = new StringBuffer();
				StringBuffer sOther = new StringBuffer();
				StringBuffer sAchieve = new StringBuffer();
				StringBuffer sReason = new StringBuffer();
				StringBuffer sCity = new StringBuffer();
				StringBuffer sDepartment = new StringBuffer();
				job = info.substring(0, length);
				StringReader sr = new StringReader(job);
				IKSegmenter ik = new IKSegmenter(sr, true);
				while ((lex = ik.next()) != null) {
					iDepartment--;
					iCompany--;
					iTitle--;
					iReport--;
					iMember--;
					iDuty--;
					iOther--;
					iAchieve--;
					iReason--;
					iCity--;
					temp = lex.getLexemeText();
					// System.out.println(temp);
					if (m_UserDic.containsKey(temp)) {
						type = m_UserDic.get(temp);
						switch (type) {
						/*
						 * case 208: bCompany = true; iCompany = 2; bDepartment
						 * =bTitle = bReport = bMember = bDuty = bOther =
						 * bAchieve = bReason = bCity = false; break; //
						 */
						case 15:
							bCompany = true;
							iCompany = 3;
							bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						case 3:
							bCompany = true;
							iCompany = 3;
							bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						/*
						 * case 209: bTitle = true; iTitle = 2; bDepartment
						 * =bCompany = bReport = bMember = bDuty = bOther =
						 * bAchieve = bReason = bCity = false; break; //
						 */
						case 14:
							bTitle = true;
							iTitle = 3;
							bDepartment = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						case 300:
							bMember = true;
							iMember = 2;
							bDepartment = bTitle = bCompany = bReport = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						case 301:
							bDuty = true;
							iDuty = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bOther = bAchieve = bReason = bCity = false;
							break;
						case 302:
							bAchieve = true;
							iAchieve = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bReason = bCity = false;
							break;
						case 303:
							bReason = true;
							iReason = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bCity = false;
							break;
						case 304:
							bCity = true;
							iCity = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = false;
							break;
						case 306:
							bReport = true;
							iReport = 2;
							bDepartment = bTitle = bCompany = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						case 307:
							bOther = true;
							iOther = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
							break;
						case 308:
							bDepartment = true;
							iDepartment = 2;
							bOther = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
							break;
						default:
							break;
						}
					}
					if (bDepartment && (iDepartment == 1)) {
						if (sDepartment.length() <= 10) {
							sDepartment.append(temp);
							iDepartment = 2;
						} else {
							bDepartment = false;
						}
					}
					if (bCompany && (iCompany == 1)) {
						if (sCompany.length() <= 15) {
							sCompany.append(temp);
							iCompany = 2;
						} else {
							bCompany = false;
						}
					}
					if (bCompany && (iCompany == 3)) {
						// System.out.println("find title");
						if (sCompany.length() == 0) {
							// System.out.println("add title");
							sCompany.append(temp);
							iCompany = 0;
							bCompany = false;
						}
					}
					/*
					 * if (bTitle && (iTitle == 1)) { if(sTitle.length()<=10) {
					 * sTitle.append(temp); iTitle = 2; }else{ bTitle = false; }
					 * } //
					 */
					if (bTitle && (iTitle == 3)) {
						if (sTitle.length() == 0) {
							sTitle.append(temp);
							iTitle = 0;
							bTitle = false;
						}
					}
					if (bReport && (iReport == 1)) {
						sReport.append(temp);
						iReport = 2;
					}
					if (bMember && (iMember == 1)) {
						sMember.append(temp);
						iMember = 2;
					}
					if (bDuty && (iDuty == 1)) {
						sDuty.append(temp);
						iDuty = 2;
					}
					if (bOther && (iOther == 1)) {
						sOther.append(temp);
						iOther = 2;
					}
					if (bAchieve && (iAchieve == 1)) {
						sAchieve.append(temp);
						iAchieve = 2;
					}
					if (bReason && (iReason == 1)) {
						sReason.append(temp);
						iReason = 2;
					}
					if (bCity && (iCity == 1)) {
						if (sCity.length() <= 8) {
							sCity.append(temp);
							iCity = 2;
						} else {
							bCity = false;
						}
					}
				}
				Job jobinfo = new Job();
				String text = sList.get(i);
				jobinfo.setStartTime(getStartTime(text));
				String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
				jobinfo.setEndTime(getStartTime(textSen));
				jobinfo.setAchieve(sAchieve.toString());
				jobinfo.setCity(sCity.toString());
				jobinfo.setCompany(sCompany.toString());
				if (jobinfo.getCompany().length() > 50) {
					jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
				}
				jobinfo.setDuty(sDuty.toString());
				jobinfo.setDepartment(sDepartment.toString());
				jobinfo.setReport(sReport.toString());
				jobinfo.setReason(sReason.toString());
				jobinfo.setMember(sMember.toString());
				jobinfo.setTitle(sTitle.toString());
				if (jobinfo.getTitle().length() > 12) {
					jobinfo.setTitle(jobinfo.getTitle().substring(0, 11));
				}
				jobinfo.setInfo(sDepartment.toString() + sReport.toString() + sDuty.toString() + sReason.toString());
				if (jobinfo.getInfo() != null && !jobinfo.getInfo().trim().equals("")) {
					jobinfo.setDuty(jobinfo.getInfo());
				}
				// jobinfo.setJobInfo(info.trim());
				if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
					String tempjob = job;
					Pattern pattern1 = Pattern.compile( //
							"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
									+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
									+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
									+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
									+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
									+ "((19\\d{2}|20\\d{2})\\s*年)|" //
									+ "((19\\d{2}|20\\d{2}))");
					Matcher matcher1 = pattern1.matcher(tempjob);
					while (matcher1.find()) {
						String str = matcher1.group();
						tempjob = tempjob.replaceAll(str, "");
						// tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—", "");
					}
					// System.out.println("tempjob = " + tempjob);
					tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
					// System.out.println("tempjob = " + tempjob);
					tempjob = tempjob.replaceFirst("至", "");
					pattern1 = Pattern.compile("股份有限公司|有限责任公司|有限公司");
					matcher1 = pattern1.matcher(tempjob);
					while (matcher1.find()) {
						jobinfo.setCompany(tempjob.substring(0, matcher1.start()) + matcher1.group());
						break;
					}
					if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
						if (jobinfo.getTitle() == null || jobinfo.getTitle().equals("")) {
							/*
							 * List<Integer> iList1 = new ArrayList<Integer>();
							 * List<String> sList1 = new ArrayList<String>();
							 * String tempjob = job; Pattern pattern1 = Pattern
							 * .compile(
							 * "((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 |((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))"
							 * ); Matcher matcher1 = pattern1.matcher(tempjob);
							 * while (matcher1.find()) { String str =
							 * matcher1.group(); tempjob =
							 * tempjob.replaceAll(str, ""); //tempjob =
							 * tempjob.replaceAll("-|\\/|\\|\\.|—", ""); }
							 * //System.out.println("tempjob = " + tempjob);
							 * tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–",
							 * ""); //System.out.println("tempjob = " +
							 * tempjob); tempjob = tempjob.replaceFirst("至",
							 * ""); pattern1 = Pattern
							 * .compile("股份有限公司|有限责任公司|有限公司"); matcher1 =
							 * pattern1.matcher(tempjob); while
							 * (matcher1.find()) { System.out.println(
							 * "company = " + matcher1.group());
							 * System.out.println("sub = " +
							 * tempjob.substring(0, matcher1.start()) +
							 * matcher1.group());
							 * jobinfo.setCompany(tempjob.substring(0,
							 * matcher1.start()) + matcher1.group()); break; }
							 * //
							 */
						} else {
							List<Integer> iList1 = new ArrayList<Integer>();
							List<String> sList1 = new ArrayList<String>();
							tempjob = job;
							pattern1 = Pattern.compile( //
									"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
											+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
											+ "((19\\d{2}|20\\d{2})\\s*年)|" //
											+ "((19\\d{2}|20\\d{2}))");
							matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								String str = matcher1.group();
								tempjob = tempjob.replaceAll(str, "");
								// tempjob =
								// tempjob.replaceAll("-|\\/|\\|\\.|—", "");
							}
							// System.out.println("tempjob = " + tempjob);
							tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
							// System.out.println("tempjob = " + tempjob);
							tempjob = tempjob.replaceFirst("至", "");
							pattern1 = Pattern.compile(jobinfo.getTitle());
							matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								jobinfo.setCompany(tempjob.substring(0, matcher1.start()));
								if (jobinfo.getCompany().length() > 50) {
									jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
								}
								break;
							}
						}
					}
				}
				jList.add(jobinfo);
				sDepartment = sAchieve = sCity = sCompany = sDuty = sMember = sReport = sReason = sMember = sTitle = null;
				jobinfo = null;
			} // else iList.size() <= 2
			i += 2;
		} // for
		
		//清洗公司名
		List<Job> jobs = new ArrayList<Job>();
		if(jList!=null)
			for(Job jo:jList){
				if(jo!=null&&jo.getCompany()!=null&&jo.getCompany().startsWith(":")){
					jo.setCompany(jo.getCompany().substring(1)); 
				}
				jobs.add(jo);
			}
//		map.setJobs(jList);
		map.setJobs(jobs);
		iList = null;
		sList = null;
		jList = null;
		if (flag == 1) {
			for (int i = 0; i < 11; i++) {
				if (indexType[0][i] == 0) {
					switch (indexType[1][i]) {
					case 0:
						parseBasic(info, map, indexType, 0);
						if (map.getBasic().getName() == null || map.getBasic().getName().equals("")) {
							// detectName(content,map);
						}
						break;
					case 1:
						// parseEducation(info,map,indexType,0);
						break;
					case 2:
						// parseJob(info,map,indexType,0);
						break;
					case 3:
						// parseProject(info,map,indexType,0);
						break;
					case 4:
						// parseMedal(info,map,indexType,0);
						break;
					case 5:
						// parseSkill(info,map,indexType,0);
						break;
					case 6:
						// parsePaper(info,map,indexType,0);
						break;
					case 7:
						// parsePatent(info,map,indexType,0);
						break;
					case 8:
						// parseComment(info,map,indexType,0);
						break;
					case 9:
						// parseExpectation(info,map,indexType,0);
						break;
					case 10:
						// parseOther(info,map,indexType,0);
						break;
					default:
						break;
					}
				}
			}
		}
	}

	@Test
	public void testEdu() {
		Pattern p = Pattern.compile("cat");
		Matcher m = p.matcher("one cat two cats in the yard cat");
		StringBuffer sb = new StringBuffer();
		while (m.find()) {
			m.appendReplacement(sb, "dog"); // 将替换后的字符串放进sb
		}
		System.out.println(sb.toString());
		m.appendTail(sb);
		System.out.println(sb.toString());
	}

	/**
	 * 函数名：parseEducation() 功 能：识别教育背景信息块的起止时间、学校、专业、学历
	 * 
	 */
	private void parseEducation(String info, CVObject map, int[][] indexType, int flag) throws IOException {
		info = info.replaceAll("||    |||", "");
		// System.out.println(info);
		StringBuffer sEducation = new StringBuffer();
		List<Integer> iList = new ArrayList<Integer>(); // 存放位置
		List<String> sList = new ArrayList<String>(); // 粗放匹配的日期字符
		List<EducationNow> eList = new ArrayList<EducationNow>();
		if (map.getEducations() != null) {
			eList = map.getEducations();
		}
		Pattern pattern = Pattern.compile( //
				"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
						+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
						+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
						+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
						+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
						+ "((19\\d{2}|20\\d{2})\\s*年)|" //
						+ "((19\\d{2}|20\\d{2}))");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			matcher.appendReplacement(sEducation, info);
			String str = matcher.group();
			// System.out.println(str);
			sList.add(str);
			iList.add(matcher.start());
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i + 1) - iList.get(i) >= 15) {
				iList.set(i, info.length() * 2);
				i++;
			} else {
				i = i + 2;
			}
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i) == info.length() * 2) {
				iList.remove(i);
				sList.remove(i);
			} else {
				i++;
			}
		}

		if (iList.size() % 2 == 1) {
			iList.remove(iList.size() - 1);
			sList.remove(sList.size() - 1);
		}

		// 处理只有年份的情况
		if (iList.size() < 2) {
			Pattern pattern1 = Pattern.compile( //
					"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
							+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
							+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
							+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
							+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
							+ "((19\\d{2}|20\\d{2})\\s*年)|" //
							+ "((19\\d{2}|20\\d{2}))");
			Matcher matcher1 = pattern1.matcher(info);
			while (matcher1.find()) {
				String str = matcher1.group();
				sList.add(str);
				iList.add(matcher1.start());
			}

			for (Integer iListOne : iList) {
				// System.out.println(iListOne);
			}
			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i + 1) - iList.get(i) >= 15) {
					iList.set(i, info.length() * 2);
					i++;
				} else {
					i = i + 2;
				}
			}

			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i) == info.length() * 2) {
					iList.remove(i);
					sList.remove(i);
				} else {
					i++;
				}
			}

			if (iList.size() % 2 == 1) {
				iList.remove(iList.size() - 1);
				sList.remove(sList.size() - 1);
			}
		}

		int length = info.length();
		String edu = "";
		Lexeme lex = null;
		String temp = "";
		int type = 0;
		int iSchool, iMajor, iDegree;
		iSchool = iMajor = iDegree = 0;
		int maxTime = 0;
		for (int i = 0, len = iList.size(); i < len;) {
			if (iList.size() > 2) {
				if (i == 0) {
					String school = "";
					String major = "";
					String degree = "";
					edu = info.substring(iList.get(i), iList.get(i + 2));
					StringReader sr = new StringReader(edu);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iSchool--;
						iDegree--;
						iMajor--;
						temp = lex.getLexemeText();
						// System.out.println("temp = " + temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							case 3:
								iSchool = 2;
								break;
							case 5:
								degree = temp; // 学历验证
								break;
							case 13:
								iMajor = 2;
								break;
							case 251:
								// iDegree = 2;
								degree = temp;
								break;
							case 252:
								// iDegree = 2;
								degree = temp;
								break;
							case 253:
								// iDegree = 2;
								degree = temp;
								break;
							default:
								break;
							}
						}
						if (iSchool == 2) {
							if (school.isEmpty())
								school = lex.getLexemeText();
							// System.out.println(school);
						}
						if (iMajor == 2) {
							if (major.isEmpty())
								major = lex.getLexemeText();
						}
						/*
						 * if (iDegree == 1) degree = lex.getLexemeText();
						 */
					}
					EducationNow education = new EducationNow();
					String text = sList.get(i);
					education.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					education.setEndTime(getStartTime(textSen));
					education.setSchool(school);
					if (education.getSchool().length() > 22) {
						education.setSchool(education.getSchool().substring(0, 21));
					}
					// System.out.println("education school = " +
					// education.getSchool());
					education.setMajor(major);
					BasicDE basicDE = new BasicDE();
					// System.out.println("degree = " + degree);
					if (degree.contains("专科") || degree.contains("大专")) {
						basicDE.setId(3);
					} else if (degree.contains("本科") || degree.contains("学士")) {
						basicDE.setId(4);
					} else if (degree.contains("硕士") || degree.contains("研究生")) {
						basicDE.setId(5);
					} else if (degree.contains("博士")) {
						basicDE.setId(6);
					} else if (degree.contains("博士后")) {
						basicDE.setId(7);
					}
					education.setDegree(basicDE);
					// System.out.println(education.getDegree().getId());
					int staIndex = edu.indexOf(sList.get(i));
					int endIndex = staIndex;
					String subInfo = "";
					String infoFirst = "";
					if ((i + 1) < sList.size()) {
						endIndex = edu.indexOf(sList.get(i + 1));
						subInfo = edu.substring(staIndex, endIndex + sList.get(i + 1).length());
						infoFirst = edu.substring(endIndex + sList.get(i + 1).length());
						
					} else {
						subInfo = edu.substring(staIndex, staIndex + sList.get(i).length());
						infoFirst = edu.substring(staIndex + sList.get(i).length());
					}
					education.setInfo(infoFirst);
					education.setEducationInfo(info.trim());
					// System.out.println("education" + education.toString() );
					// System.out.println("degree = " +
					// education.getDegree().getId());
					// System.out.println(education.getSchool() != null &&
					// education.getDegree().getId() != 0);
					if (education.getSchool() != null && !education.getSchool().equals(
							"")/* && education.getDegree().getId() != 0 */) {
						eList.add(education);
					} else {
						// eList.add(education);
					}
					/*
					 * if(education.getDegree().getId() >
					 * map.getBasic().getDegree().getId()) {
					 * //System.out.println(">");
					 * map.getBasic().setDegree(education.getDegree());
					 * map.getBasic().setSchool(education.getSchool());
					 * map.getBasic().setMajor(education.getMajor());
					 * //System.out.println(map.getBasic().getMajor());
					 * //System.out.println(map.getBasic().getDegree());
					 * //System.out.println(map.getBasic().getSchool()); } else
					 * if(education.getDegree().getId() ==
					 * map.getBasic().getDegree().getId()) {
					 * //System.out.println(education.getEndTime()); Pattern
					 * pattern1 =
					 * Pattern.compile("((19\\d{2}|20\\d{2}))|(0000)"); Matcher
					 * matcher1 = pattern1.matcher(education.getEndTime());
					 * //System.out.println("endTime = " +
					 * education.getEndTime()); while (matcher1.find()) { String
					 * str = matcher1.group(); int tempTime =
					 * Integer.parseInt(str); //System.out.println("tempTime = "
					 * + tempTime); if(tempTime == 0) { Calendar
					 * a=Calendar.getInstance(); tempTime =
					 * a.get(Calendar.YEAR); } if(tempTime > maxTime) {
					 * map.getBasic().setDegree(education.getDegree());
					 * map.getBasic().setSchool(education.getSchool());
					 * map.getBasic().setMajor(education.getMajor()); maxTime =
					 * tempTime; } } } //
					 */
					education = null;
				} else if (i < len - 3) {
					String school = "";
					String major = "";
					String degree = "";
					edu = info.substring(iList.get(i), iList.get(i + 2));
					StringReader sr = new StringReader(edu);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iSchool--;
						iDegree--;
						iMajor--;
						temp = lex.getLexemeText();
						// System.out.println("temp = " + temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							case 3:
								iSchool = 2;
								break;
							case 13:
								iMajor = 2;
								break;
							case 5:
								// iDegree = 2;
								degree = temp;
								break;
							case 251:
								// iDegree = 2;
								degree = temp;
								break;
							case 252:
								// iDegree = 2;
								degree = temp;
								break;
							case 253:
								// iDegree = 2;
								degree = temp;
								break;
							default:
								break;
							}
						}
						if (iSchool == 2)
							if (school.isEmpty())
								school = lex.getLexemeText();
						if (iMajor == 2)
							if (major.isEmpty())
								major = lex.getLexemeText();
						/*
						 * if (iDegree == 1) degree = lex.getLexemeText();
						 */

					}
					EducationNow education = new EducationNow();
					String text = sList.get(i);
					education.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					education.setEndTime(getStartTime(textSen));
					education.setSchool(school);
					if (education.getSchool().length() > 22) {
						education.setSchool(education.getSchool().substring(0, 21));
					}
					education.setMajor(major);
					BasicDE basicDE = new BasicDE();
					if (degree.contains("专科") || degree.contains("大专")) {
						basicDE.setId(3);
					} else if (degree.contains("本科") || degree.contains("学士")) {
						basicDE.setId(4);
					} else if (degree.contains("硕士") || degree.contains("研究生")) {
						basicDE.setId(5);
					} else if (degree.contains("博士")) {
						basicDE.setId(6);
					} else if (degree.contains("博士后")) {
						basicDE.setId(7);
					}
					education.setDegree(basicDE);
					// System.out.println(education.getDegree().getId());
					/*
					 * String infoFirst = edu.replaceAll(sList.get(i), "");
					 * String infoSecond = infoFirst.replaceAll(sList.get(i+1),
					 * "");
					 */
					int staIndex = edu.indexOf(sList.get(i));
					int endIndex = staIndex;
					String subInfo = "";
					String infoFirst = "";
					if ((i + 1) < sList.size()) {
						endIndex = edu.indexOf(sList.get(i + 1));
						subInfo = edu.substring(staIndex, endIndex + sList.get(i + 1).length());
						infoFirst = edu.substring(endIndex + sList.get(i + 1).length());
					} else {
						subInfo = edu.substring(staIndex, staIndex + sList.get(i).length());
						infoFirst = edu.substring( staIndex + sList.get(i).length());
					} 
					
					education.setInfo(infoFirst);
					education.setEducationInfo(info.trim());
					// System.out.println("education" + education.toString() );
					if (education.getSchool() != null && !education.getSchool().equals(
							"") /* && education.getDegree().getId() != 0 */) {
						eList.add(education);
					} else {
						// eList.add(education);
					}
					/*
					 * if(education.getDegree().getId() >
					 * map.getBasic().getDegree().getId()) {
					 * //System.out.println(">");
					 * map.getBasic().setDegree(education.getDegree());
					 * map.getBasic().setSchool(education.getSchool());
					 * map.getBasic().setMajor(education.getMajor());
					 * //System.out.println(map.getBasic().getMajor());
					 * //System.out.println(map.getBasic().getDegree());
					 * //System.out.println(map.getBasic().getSchool()); } else
					 * if(education.getDegree().getId() ==
					 * map.getBasic().getDegree().getId()) {
					 * //System.out.println(education.getEndTime()); Pattern
					 * pattern1 =
					 * Pattern.compile("((19\\d{2}|20\\d{2}))|(0000)"); Matcher
					 * matcher1 = pattern1.matcher(education.getEndTime());
					 * //System.out.println("endTime = " +
					 * education.getEndTime()); while (matcher1.find()) { String
					 * str = matcher1.group(); int tempTime =
					 * Integer.parseInt(str); //System.out.println("tempTime = "
					 * + tempTime); if(tempTime == 0) { Calendar
					 * a=Calendar.getInstance(); tempTime =
					 * a.get(Calendar.YEAR); } if(tempTime > maxTime) {
					 * map.getBasic().setDegree(education.getDegree());
					 * map.getBasic().setSchool(education.getSchool());
					 * map.getBasic().setMajor(education.getMajor()); maxTime =
					 * tempTime; } } } //
					 */
					education = null;
				} else {
					String school = "";
					String major = "";
					String degree = "";
					edu = info.substring(iList.get(i), length);
					StringReader sr = new StringReader(edu);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iSchool--;
						iDegree--;
						iMajor--;
						temp = lex.getLexemeText();
						// System.out.println("temp = " + temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							case 3:
								iSchool = 2;
								break;
							case 13:
								iMajor = 2;
								break;
							case 5:
								// iDegree = 2;
								degree = temp;
								break;
							case 251:
								// iDegree = 2;
								degree = temp;
								break;
							case 252:
								// iDegree = 2;
								degree = temp;
								break;
							case 253:
								// iDegree = 2;
								degree = temp;
								break;
							default:
								break;
							}
						}
						if (iSchool == 2)
							if (school.isEmpty())
								school = lex.getLexemeText();
						if (iMajor == 2)
							if (major.isEmpty())
								major = lex.getLexemeText();
						/*
						 * if (iDegree == 1) degree = lex.getLexemeText();
						 */

					}
					EducationNow education = new EducationNow();
					String text = sList.get(i);
					education.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					education.setEndTime(getStartTime(textSen));
					education.setSchool(school);
					if (education.getSchool().length() > 22) {
						education.setSchool(education.getSchool().substring(0, 21));
					}
					education.setMajor(major);
					BasicDE basicDE = new BasicDE();
					if (degree.contains("专科") || degree.contains("大专")) {
						basicDE.setId(3);
					} else if (degree.contains("本科") || degree.contains("学士")) {
						basicDE.setId(4);
					} else if (degree.contains("硕士") || degree.contains("研究生")) {
						basicDE.setId(5);
					} else if (degree.contains("博士")) {
						basicDE.setId(6);
					} else if (degree.contains("博士后")) {
						basicDE.setId(7);
					}
					education.setDegree(basicDE);
					// System.out.println(education.getDegree().getId());
					int staIndex = edu.indexOf(sList.get(i));
					int endIndex = staIndex;
					String subInfo = "";
					String infoFirst ="";
					if ((i + 1) < sList.size()) {
						endIndex = edu.indexOf(sList.get(i + 1));
//						subInfo = edu.substring(staIndex, endIndex + sList.get(i + 1).length());
						infoFirst =edu.substring( endIndex + sList.get(i + 1).length());
					} else {
//						subInfo = edu.substring(staIndex, staIndex + sList.get(i).length());
						infoFirst =edu.substring(staIndex + sList.get(i).length());
					} 
					education.setInfo(infoFirst);
					education.setEducationInfo(info.trim());
					// System.out.println("education" + education.toString() );
					if (education.getSchool() != null && !education.getSchool().equals(
							"") /* && education.getDegree().getId() != 0 */) {
						eList.add(education);
					} else {
						// eList.add(education);
					}
					/*
					 * if(education.getDegree().getId() >
					 * map.getBasic().getDegree().getId()) {
					 * //System.out.println(">");
					 * map.getBasic().setDegree(education.getDegree());
					 * map.getBasic().setSchool(education.getSchool());
					 * map.getBasic().setMajor(education.getMajor());
					 * //System.out.println(map.getBasic().getMajor());
					 * //System.out.println(map.getBasic().getDegree());
					 * //System.out.println(map.getBasic().getSchool()); } else
					 * if(education.getDegree().getId() ==
					 * map.getBasic().getDegree().getId()) {
					 * //System.out.println(education.getEndTime()); Pattern
					 * pattern1 =
					 * Pattern.compile("((19\\d{2}|20\\d{2}))|(0000)"); Matcher
					 * matcher1 = pattern1.matcher(education.getEndTime());
					 * //System.out.println("endTime = " +
					 * education.getEndTime()); while (matcher1.find()) { String
					 * str = matcher1.group(); int tempTime =
					 * Integer.parseInt(str); //System.out.println("tempTime = "
					 * + tempTime); if(tempTime == 0) { Calendar
					 * a=Calendar.getInstance(); tempTime =
					 * a.get(Calendar.YEAR); } if(tempTime > maxTime) {
					 * map.getBasic().setDegree(education.getDegree());
					 * map.getBasic().setSchool(education.getSchool());
					 * map.getBasic().setMajor(education.getMajor()); maxTime =
					 * tempTime; } } } //
					 */
					education = null;
				}
			} else // iList.size < 2
			{
				// System.out.println("list size <= 2");
				String school = "";
				String major = "";
				String degree = "";
				edu = info.substring(0, length);
				StringReader sr = new StringReader(edu);
				IKSegmenter ik = new IKSegmenter(sr, true);
				while ((lex = ik.next()) != null) {
					iSchool--;
					iDegree--;
					iMajor--;
					temp = lex.getLexemeText();
					// System.out.println("temp = " + temp);
					if (m_UserDic.containsKey(temp)) {
						type = m_UserDic.get(temp);
						switch (type) {
						case 3:
							iSchool = 2;
							break;
						case 13:
							iMajor = 2;
							break;
						case 5:
							// iDegree = 2;
							degree = temp;
							break;
						case 251:
							// iDegree = 2;
							// degree = temp;
							break;
						case 252:
							// iDegree = 2;
							// degree = temp;
							break;
						case 253:
							// iDegree = 2;
							// degree = temp;
							break;
						default:
							break;
						}
					}
					if (iSchool == 2)
						if (school.isEmpty())
							school = lex.getLexemeText();
					if (iMajor == 2)
						if (major.isEmpty())
							major = lex.getLexemeText();
					/*
					 * if (iDegree == 1) degree = lex.getLexemeText();
					 */

				}
				EducationNow education = new EducationNow();
				String text = sList.get(i);
				education.setStartTime(getStartTime(text));
				String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
				education.setEndTime(getStartTime(textSen));
				education.setSchool(school);
				if (education.getSchool().length() > 22) {
					education.setSchool(education.getSchool().substring(0, 21));
				}
				education.setMajor(major);
				BasicDE basicDE = new BasicDE();
				// System.out.println(degree);
				// System.out.println(degree.contains("本科"));
				if (degree.contains("专科") || degree.contains("大专")) {
					basicDE.setId(3);
				} else if (degree.contains("本科") || degree.contains("学士")) {
					basicDE.setId(4);
				} else if (degree.contains("硕士") || degree.contains("研究生")) {
					basicDE.setId(5);
				} else if (degree.contains("博士")) {
					basicDE.setId(6);
				} else if (degree.contains("博士后")) {
					basicDE.setId(7);
				}
				education.setDegree(basicDE);
				// System.out.println(education.getDegree().getId());
				int staIndex = edu.indexOf(sList.get(i));
				int endIndex = staIndex;
				String subInfo = "";
				String infoFirst = "";
				if ((i + 1) < sList.size()) {
					endIndex = edu.indexOf(sList.get(i + 1));
					subInfo = edu.substring(staIndex, endIndex + sList.get(i + 1).length());
					infoFirst = edu.substring(sList.get(i + 1).length());
				} else {
					subInfo = edu.substring(staIndex, staIndex + sList.get(i).length());
					infoFirst = edu.substring(staIndex + sList.get(i).length());
				} 
				education.setInfo(infoFirst);
				education.setEducationInfo(info.trim());
				// System.out.println("education" + education.toString() );
				if (education.getSchool() != null && !education.getSchool()
						.equals("") /* && education.getDegree().getId() != 0 */) {
					eList.add(education);
				} else {
					// eList.add(education);
				}
				/*
				 * if(education.getDegree().getId() >
				 * map.getBasic().getDegree().getId()) {
				 * //System.out.println(">");
				 * map.getBasic().setDegree(education.getDegree());
				 * map.getBasic().setSchool(education.getSchool());
				 * map.getBasic().setMajor(education.getMajor());
				 * //System.out.println(map.getBasic().getMajor());
				 * //System.out.println(map.getBasic().getDegree());
				 * //System.out.println(map.getBasic().getSchool()); } else
				 * if(education.getDegree().getId() ==
				 * map.getBasic().getDegree().getId()) {
				 * //System.out.println(education.getEndTime()); Pattern
				 * pattern1 = Pattern.compile("((19\\d{2}|20\\d{2}))|(0000)");
				 * Matcher matcher1 = pattern1.matcher(education.getEndTime());
				 * //System.out.println("endTime = " + education.getEndTime());
				 * while (matcher1.find()) { String str = matcher1.group(); int
				 * tempTime = Integer.parseInt(str); //System.out.println(
				 * "tempTime = " + tempTime); if(tempTime == 0) { Calendar
				 * a=Calendar.getInstance(); tempTime = a.get(Calendar.YEAR); }
				 * if(tempTime > maxTime) {
				 * map.getBasic().setDegree(education.getDegree());
				 * map.getBasic().setSchool(education.getSchool());
				 * map.getBasic().setMajor(education.getMajor()); maxTime =
				 * tempTime; } } } //
				 */
				education = null;
			}
			i += 2;
		}
		// System.out.println("degree = " + map.getBasic().getDegree().getId());
		map.setEducations(eList);
		// System.out.println("school");
		/*
		 * for(EducationNow eListOne:eList) { System.out.println("school = " +
		 * eListOne.getSchool()); } //
		 */
		iList = null;
		sList = null;
		eList = null;
		if (flag == 1) {
			for (int i = 0; i < 11; i++) {
				if (indexType[0][i] == 0) {
					switch (indexType[1][i]) {
					case 0:
						parseBasic(info, map, indexType, 0);
						if (map.getBasic().getName() == null || map.getBasic().getName().equals("")) {
							// detectName(content,map);
						}
						break;
					case 1:
						// parseEducation(info,map,indexType,0);
						break;
					case 2:
						// parseJob(info,map,indexType,0);
						break;
					case 3:
						// parseProject(info,map,indexType,0);
						break;
					case 4:
						// parseMedal(info,map,indexType,0);
						break;
					case 5:
						// parseSkill(info,map,indexType,0);
						break;
					case 6:
						// parsePaper(info,map,indexType,0);
						break;
					case 7:
						// parsePatent(info,map,indexType,0);
						break;
					case 8:
						// parseComment(info,map,indexType,0);
						break;
					case 9:
						// parseExpectation(info,map,indexType,0);
						break;
					case 10:
						// parseOther(info,map,indexType,0);
						break;
					default:
						break;
					}
				}
			}
		}
	}

	private void parseGen(String info, CVObject map) throws IOException {
		info = info.replaceAll("||    |||", "");
		// System.out.println("Parse Gen");
		StringBuilder sName = new StringBuilder();
		StringBuilder sLocation = new StringBuilder();
		StringBuilder sSchool = new StringBuilder();
		StringBuilder sDegree = new StringBuilder();
		StringBuilder sCompany = new StringBuilder();
		StringBuilder sTitle = new StringBuilder();
		StringBuilder sHeight = new StringBuilder();
		StringBuilder sWeight = new StringBuilder();
		StringBuilder sBWH = new StringBuilder();
		StringBuilder sMarriage = new StringBuilder();
		StringBuilder sNation = new StringBuilder();
		StringBuilder sMajor = new StringBuilder();
		StringBuilder sPolitics = new StringBuilder();
		StringBuilder sCountry = new StringBuilder();
		StringBuilder sHealth = new StringBuilder();
		String basicSchool = "";
		int iBasicSchool, iCountry, iHealth, iPolitics, iName, iLocation, iSchool, iDegree, iCompany, iTitle, iHeight,
				iWeight, iBWH, iMarriage, iNation, iMajor;
		iBasicSchool = iCountry = iHealth = iPolitics = iName = iLocation = iSchool = iDegree = iCompany = iTitle = iHeight = iWeight = iBWH = iMarriage = iNation = iMajor = 0;
		boolean bCountry, bHealth, bPolitics, bName, bLocation, bSchool, bDegree, bCompany, bTitle, bHeight, bWeight,
				bBWH, bMarriage, bNation, bMajor;
		bCountry = bHealth = bPolitics = bName = bLocation = bSchool = bDegree = bCompany = bTitle = bHeight = bWeight = bBWH = bMarriage = bNation = bMajor = false;
		boolean bBasicSchool = true;
		int type = 0;
		StringReader sr = new StringReader(info);
		IKSegmenter ik = new IKSegmenter(sr, true);
		Lexeme lex = null;
		String temp = "";
		while ((lex = ik.next()) != null) {
			iHealth--;
			iCountry--;
			iPolitics--;
			iName--;
			iLocation--;
			iSchool--;
			iDegree--;
			iCompany--;
			iTitle--;
			iHeight--;
			iWeight--;
			iBWH--;
			iMarriage--;
			iNation--;
			iMajor--;
			iBasicSchool--;
			temp = lex.getLexemeText();
			if (temp != null && m_UserDic.containsKey(temp)) {
				type = m_UserDic.get(temp);
				switch (type) {
				case 3:
					iBasicSchool = 1;
					break;
				case 200:
					bName = true;
					iName = 2;
					bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 201:
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 202:
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 203:
					bLocation = true;
					bName = bSchool = bCompany = bMajor = false;
					iLocation = 2;
					break;
				case 204:
					bSchool = true;
					iSchool = 2;
					bName = bLocation = bCompany = bMajor = false;
					break;
				case 205:
					bDegree = true;
					iDegree = 2;
					bCompany = bName = bLocation = bSchool = bMajor = false;
					break;
				case 206:
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 207:
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 208:
					bCompany = true;
					iCompany = 2;
					bName = bSchool = bLocation = bMajor = false;
					break;
				case 209:
					bTitle = true;
					iTitle = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 210:
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 211:
					bHeight = true;
					iHeight = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 212:
					bWeight = true;
					iWeight = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 213:
					bBWH = true;
					iBWH = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 214:
					bMarriage = true;
					iMarriage = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 215:
					bNation = true;
					iNation = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 216:
					bMajor = true;
					iMajor = 2;
					bCompany = bName = bSchool = bLocation = false;
					break;
				case 217:
					bHealth = true;
					iHealth = 2;
					bMajor = bCompany = bName = bSchool = bLocation = false;
					break;
				case 218:
					bCountry = true;
					iCountry = 2;
					bMajor = bCompany = bName = bSchool = bLocation = false;
					break;
				case 219:
					bPolitics = true;
					iPolitics = 2;
					bMajor = bCompany = bName = bSchool = bLocation = false;
					break;
				default:
					break;
				}
			}
			if (bBasicSchool && iBasicSchool == 1) {
				basicSchool = temp;
				bBasicSchool = false;
			}
			if (bCountry && iCountry == 1) {
				sCountry.append(temp);
			}
			if (bHealth && iHealth == 1) {
				sHealth.append(temp);
			}
			if (bPolitics && iPolitics == 1) {
				sPolitics.append(temp);
			}
			if (bName && iName == 1) {
				if (sName != null && sName.length() <= 10) {
					sName.append(temp);
					iName = 2;
				}
			}
			if (bLocation && iLocation == 1) {
				if (sLocation != null && sLocation.length() <= 15) {
					sLocation.append(temp);
					iLocation = 2;
				}
			}
			if (bSchool && iSchool == 1) {
				if (sSchool != null && sSchool.length() <= 15) {
					sSchool.append(temp);
					iSchool = 2;
				}
			}
			if (bDegree && iDegree == 1) {
				sDegree.append(temp);
			}
			if (bCompany && iCompany == 1) {
				if (sCompany != null && sCompany.length() <= 20) {
					sCompany.append(temp);
					iCompany = 2;
				}
			}
			if (bTitle && iTitle == 1)
				sTitle.append(temp);
			if (bHeight && iHeight == 1)
				sHeight.append(temp);
			if (bWeight && iWeight == 1)
				sWeight.append(temp);
			if (bBWH && iBWH == 1)
				sBWH.append(temp);
			if (bMarriage && iMarriage == 1)
				sMarriage.append(temp);
			if (bNation && iNation == 1)
				sNation.append(temp);
			if (bMajor && iMajor == 1) {
				if (sMajor != null && sMajor.length() <= 10) {
					sMajor.append(temp);
					iMajor = 2;
				}
			}
		}

		BasicNow basic = new BasicNow();
		BasicCV cv = new BasicCV();
		cv.setId(0);
		BasicES es = new BasicES();
		es.setId(67);
		basic.setExpectedSalary(es);
		BasicFunction function = new BasicFunction();
		function.setId(0);
		basic.setFunctionId(function);
		BasicJS js = new BasicJS();
		js.setId(65);
		basic.setMpc(0);
		basic.setJobStatus(js);
		BasicJT jt = new BasicJT();
		Pattern pjobTime = Pattern.compile("\\d{1}");
		Matcher mjobTime = pjobTime.matcher(jobtime);
		String tempJobTime = "";
		while (mjobTime.find()) {
			tempJobTime = mjobTime.group();
			break;
		}
		Pattern pjobTime2 = Pattern.compile("\\d{2}");
		Matcher mjobTime2 = pjobTime2.matcher(jobtime);
		while (mjobTime2.find()) {
			tempJobTime = mjobTime2.group();
			break;
		}
		int intJobTime = 0;
		if (tempJobTime != null && !tempJobTime.equals("")) {
			intJobTime = Integer.parseInt(tempJobTime);
		}
		if (intJobTime >= 1 && intJobTime <= 3) {
			jt.setId(12);
		} else if (intJobTime > 3 && intJobTime <= 5) {
			jt.setId(102);
		} else if (intJobTime > 5 && intJobTime <= 10) {
			jt.setId(103);
		} else if (intJobTime > 10) {
			jt.setId(104);
		} else {
			jt.setId(11);
		}

		basic.setCv(cv);
		basic.setAge(getAgeNum(age));
		basic.setGender(gender.equals("女") ? 2 : 0);
		if (basic.getGender() == 0) {
			basic.setGender(gender.equals("男") ? 1 : 0);
		}
		basic.setEmail(email);
		phone = phone.replaceAll("-", "");
		basic.setMobile(phone);
		// basic.setJobTime(jt);
		Long longJobTime = new Long((long) intJobTime);
		basic.setJob_time(longJobTime);
		BasicDE basicDE = new BasicDE();
		if (degree != null && (degree.contains("专科") || degree.contains("大专"))) {
			basicDE.setId(3);
		} else if (degree != null && degree.contains("本科") || degree != null && degree.contains("学士")) {
			basicDE.setId(4);
		} else if (degree != null && degree.contains("硕士") || degree != null && degree.contains("研究生")) {
			basicDE.setId(5);
		} else if (degree != null && degree.contains("博士")) {
			basicDE.setId(6);
		} else if (degree != null && degree.contains("博士后")) {
			basicDE.setId(7);
		}
		basic.setDegree(basicDE);
		basic.setHealth(sHealth.toString());
		basic.setCountry(sCountry.toString());
		basic.setPolitics(sPolitics.toString());
		if (map.getBasic() != null) {
			if (map.getBasic().getName() == null || map.getBasic().getName().equals(""))
				basic.setName(sName.toString());
			else
				basic.setName(map.getBasic().getName());
		} else {
			basic.setName(sName.toString());
		}
		// basic.setName(sName.toString());
		basic.setAddress(sLocation.toString());
		if (map.getBasic() != null) {
			if (map.getBasic().getSchool() == null || map.getBasic().getSchool().equals("")) {
				basic.setSchool(basicSchool);
				if (basic.getSchool().length() > 22) {
					basic.setSchool(basic.getSchool().substring(0, 21));
				}
			} else {
				basic.setSchool(map.getBasic().getSchool());
				if (basic.getSchool().length() > 22) {
					basic.setSchool(basic.getSchool().substring(0, 21));
				}
			}
		} else {
			basic.setSchool(basicSchool);
			if (basic.getSchool().length() > 22) {
				basic.setSchool(basic.getSchool().substring(0, 21));
			}
		}
		// System.out.println("basic" + basic.toString() );
		map.setBasic(basic);

	}

	/**
	 * 函数名：parseBasic() 功 能：识别基本信息块的姓名、性别、年龄、现居地、学校、学历 * 手机、邮箱、公司、职位、专业等。
	 * 
	 */
	private void parseBasic(String info, CVObject map, int[][] indexType, int flag) throws IOException {
		info = info.replaceAll("||    |||", "");

		StringBuilder sName = new StringBuilder();
		StringBuilder sLocation = new StringBuilder();
		StringBuilder sSchool = new StringBuilder();
		StringBuilder sDegree = new StringBuilder();
		StringBuilder sCompany = new StringBuilder();
		StringBuilder sTitle = new StringBuilder();
		StringBuilder sHeight = new StringBuilder();
		StringBuilder sWeight = new StringBuilder();
		StringBuilder sBWH = new StringBuilder();
		StringBuilder sMarriage = new StringBuilder();
		StringBuilder sNation = new StringBuilder();
		StringBuilder sMajor = new StringBuilder();
		StringBuilder sPolitics = new StringBuilder();
		StringBuilder sCountry = new StringBuilder();
		StringBuilder sHealth = new StringBuilder();
		String basicSchool = "";
		String sCity = "";
		int iBasicSchool, iCountry, iHealth, iPolitics, iName, iLocation, iSchool, iDegree, iCompany, iTitle, iHeight,
				iWeight, iBWH, iMarriage, iNation, iMajor;
		iBasicSchool = iCountry = iHealth = iPolitics = iName = iLocation = iSchool = iDegree = iCompany = iTitle = iHeight = iWeight = iBWH = iMarriage = iNation = iMajor = 0;
		boolean bCountry, bHealth, bPolitics, bName, bLocation, bSchool, bDegree, bCompany, bTitle, bHeight, bWeight,
				bBWH, bMarriage, bNation, bMajor;
		bCountry = bHealth = bPolitics = bName = bLocation = bSchool = bDegree = bCompany = bTitle = bHeight = bWeight = bBWH = bMarriage = bNation = bMajor = false;
		int type = 0;
		boolean bBasicSchool = true;
		// 去空格
		// info = info.replaceAll("\\s+", "");
		info = info.replace(" ", "");
		StringReader sr = new StringReader(info);
		IKSegmenter ik = new IKSegmenter(sr, true);
		Lexeme lex = null;
		String temp = "";
		while ((lex = ik.next()) != null) {
			iBasicSchool--;
			iHealth--;
			iCountry--;
			iPolitics--;
			iName--;
			iLocation--;
			iSchool--;
			iDegree--;
			iCompany--;
			iTitle--;
			iHeight--;
			iWeight--;
			iBWH--;
			iMarriage--;
			iNation--;
			iMajor--;
			temp = lex.getLexemeText();
			if (temp != null && m_UserDic.containsKey(temp)) {
				type = m_UserDic.get(temp);
				switch (type) {
				case 3: // 学校
					iBasicSchool = 1;
					break;
				case 200: // 姓名
					bName = true; // 禁用姓名解析
					iName = 2;
					bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 201: // 性别
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 202: // 年龄
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 203: // 居住地
					bLocation = true;
					bName = bSchool = bCompany = bMajor = false;
					iLocation = 2;
					break;
				case 204: // 毕业学校
					bSchool = true;
					iSchool = 2;
					bName = bLocation = bCompany = bMajor = false;
					break;
				case 205: // 学历
					bDegree = true;
					iDegree = 2;
					bCompany = bName = bLocation = bSchool = bMajor = false;
					break;
				case 206: // 手机
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 207: // 邮箱
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 208: // 公司
					bCompany = true;
					iCompany = 2;
					bName = bSchool = bLocation = bMajor = false;
					break;
				case 209: // 职位
					bTitle = true;
					iTitle = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 210: // 工作年限
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 211: // 身高
					bHeight = true;
					iHeight = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 212: // 体重
					bWeight = true;
					iWeight = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 213: // 三围
					bBWH = true;
					iBWH = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 214: // 婚姻状况
					bMarriage = true;
					iMarriage = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 215: // 名族
					bNation = true;
					iNation = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 216: // 专业
					bMajor = true;
					iMajor = 2;
					bCompany = bName = bSchool = bLocation = false;
					break;
				case 217: // 身体状况
					bHealth = true;
					iHealth = 2;
					bMajor = bCompany = bName = bSchool = bLocation = false;
					break;
				case 218: // 国籍
					bCountry = true;
					iCountry = 2;
					bMajor = bCompany = bName = bSchool = bLocation = false;
					break;
				case 219: // 政治面貌
					bPolitics = true;
					iPolitics = 2;
					bMajor = bCompany = bName = bSchool = bLocation = false;
					break;
				case 16: // 城市（一堆）
					if (sCity == null || sCity.equals("")) {
						sCity = temp;
					}
				default:
					break;
				}
			}
			if (bBasicSchool && iBasicSchool == 1) {
				basicSchool = temp;
			}
			if (bCountry && iCountry == 1) {
				sCountry.append(temp);
			}
			if (bHealth && iHealth == 1) {
				sHealth.append(temp);
			}
			if (bPolitics && iPolitics == 1) {
				sPolitics.append(temp);
			}
			if (bName && iName == 1) {
				if (sName != null && sName.length() <= 10) {
					sName.append(temp);
					iName = 2;
				}
			}

			if (bLocation && iLocation == 1) {
				if (sLocation != null && sLocation.length() <= 15) {
					sLocation.append(temp);
					// iLocation = 2;//zzh
				}
			}
			if (bSchool && iSchool == 1) {
				if (sSchool != null && sSchool.length() <= 15) {
					sSchool.append(temp);
					iSchool = 2;
				}
			}
			if (bDegree && iDegree == 1) {
				sDegree.append(temp);
			}
			if (bCompany && iCompany == 1) {
				if (sCompany != null && sCompany.length() <= 15) { // 20
					sCompany.append(temp);
					iCompany = 2;
				}
			}
			if (bTitle && iTitle == 1)
				sTitle.append(temp);
			if (bHeight && iHeight == 1)
				sHeight.append(temp);
			if (bWeight && iWeight == 1)
				sWeight.append(temp);
			if (bBWH && iBWH == 1)
				sBWH.append(temp);
			if (bMarriage && iMarriage == 1)
				sMarriage.append(temp);
			if (bNation && iNation == 1)
				sNation.append(temp);
			if (bMajor && iMajor == 1) {
				// System.out.println("major =" + sMajor + "=");
				// System.out.println(sMajor.length()==0);
				if (sMajor.length() == 0 && sMajor.length() <= 6) { // 10
					sMajor.append(temp);
					iMajor = 2;
				}
			}
		}

		BasicNow basic = new BasicNow();
		BasicES es = new BasicES();
		es.setId(67);
		basic.setExpectedSalary(es);
		BasicFunction function = new BasicFunction();
		function.setId(0);
		basic.setFunctionId(function);
		BasicJS js = new BasicJS();
		js.setId(65);
		basic.setJobStatus(js);
		BasicJT jt = new BasicJT();
		Pattern pjobTime = Pattern.compile("\\d{1}");
		Matcher mjobTime = pjobTime.matcher(jobtime);
		String tempJobTime = "";
		while (mjobTime.find()) {
			tempJobTime = mjobTime.group();
			break;
		}

		Pattern pjobTime2 = Pattern.compile("\\d{2}");
		Matcher mjobTime2 = pjobTime2.matcher(jobtime);
		while (mjobTime2.find()) {
			tempJobTime = mjobTime2.group();
			break;
		}
		int intJobTime = 0;
		if (tempJobTime != null && !tempJobTime.equals("")) {
			intJobTime = Integer.parseInt(tempJobTime);
		}
		if (intJobTime >= 1 && intJobTime <= 3) {
			jt.setId(12);
		} else if (intJobTime > 3 && intJobTime <= 5) {
			jt.setId(102);
		} else if (intJobTime > 5 && intJobTime <= 10) {
			jt.setId(103);
		} else if (intJobTime > 10) {
			jt.setId(104);
		} else {
			jt.setId(11);
		}

		BasicCV cv = new BasicCV();
		cv.setId(0);
		basic.setCv(cv);
		BasicDE basicDE = new BasicDE();
		if (degree != null && (degree.contains("专科") || degree.contains("大专"))) {
			basicDE.setId(3);
		} else if (degree != null && degree.contains("本科") || degree != null && degree.contains("学士")) {
			basicDE.setId(4);
		} else if (degree != null && degree.contains("硕士") || degree != null && degree.contains("研究生")) {
			basicDE.setId(5);
		} else if (degree != null && degree.contains("博士")) {
			basicDE.setId(6);
		} else if (degree != null && degree.contains("博士后")) {
			basicDE.setId(7);
		} else {
			basicDE.setId(0);
		}
		basic.setDegree(basicDE);
		basic.setMpc(0);
		basic.setCountry(sCountry.toString());
		basic.setHealth(sHealth.toString());
		basic.setPolitics(sPolitics.toString());
		basic.setBasicInfo(info);
		if (map.getBasic() != null) {
			if (map.getBasic().getName() == null || map.getBasic().getName().equals(""))
				basic.setName(sName.toString());
			else
				basic.setName(map.getBasic().getName());
		} else {
			basic.setName(sName.toString());
		}
		// 若分词中无法取出名字，则从基本信息中提取
		if (sName == null || sName.toString().trim().equals("")) {
			// ImportList il = new ImportList();
			String name = detectName1(info);
			basic.setName(name);
		}
		basic.setGender(gender.equals("女") ? 2 : 0);
		if (basic.getGender() == 0) {
			basic.setGender(gender.equals("男") ? 1 : 0);
		}
		basic.setAge(getAgeNum(age));
		basic.setAddress(sLocation.toString());
		if (map.getBasic() != null) {
			if (map.getBasic().getSchool() == null || map.getBasic().getSchool().equals("")) {
				basic.setSchool(basicSchool);
				if (basic.getSchool().length() > 22) {
					basic.setSchool(basic.getSchool().substring(0, 21));
				}
			} else {
				basic.setSchool(map.getBasic().getSchool());
				if (basic.getSchool().length() > 22) {
					basic.setSchool(basic.getSchool().substring(0, 21));
				}
			}
		} else {
			basic.setSchool(basicSchool);
			if (basic.getSchool().length() > 22) {
				basic.setSchool(basic.getSchool().substring(0, 21));
			}
		}
		// basic.setSchool(basicSchool);
		phone = phone.replaceAll("-", "");
		basic.setMobile(phone);
		basic.setEmail(email);
		// basic.setJobTime(jt);
		Long longJobTime = new Long((long) intJobTime);
		basic.setJob_time(longJobTime);
		basic.setCompany(sCompany.toString());
		if (basic.getCompany().length() > 50) {
			basic.setCompany(basic.getCompany().substring(0, 49));
		}
		basic.setTitle(sTitle.toString());
		if (basic.getTitle().length() > 12) {
			basic.setTitle(basic.getTitle().substring(0, 11));
		}
		basic.setHeight(sHeight.toString());
		basic.setWeight(sWeight.toString());
		basic.setBwh(sBWH.toString());
		basic.setMarriage(sMarriage.toString().equals("") ? 0 : 1);
		if (map.getBasic() != null) {
			if (map.getBasic().getMajor() == null || map.getBasic().getMajor().equals(""))
				basic.setMajor(sMajor.toString().trim());
			else
				basic.setMajor(map.getBasic().getMajor());
		} else {
			basic.setMajor(sMajor.toString().trim());
		}
		// basic.setMajor(sMajor.toString().trim());
		basic.setBasicInfo(info);
		basic.setCity(sCity);
		map.setBasic(basic);
		sName = sLocation = sSchool = sDegree = sCompany = sTitle = sHeight = sWeight = sBWH = sMarriage = sNation = sMajor = null;
		basic = null;
		if (flag == 1) {
			for (int i = 0; i < 11; i++) {
				if (indexType[0][i] == 0) {
					switch (indexType[1][i]) {
					case 0:
						parseBasic(info, map, indexType, 0);
						if (map.getBasic().getName() == null || map.getBasic().getName().equals("")) {
							// detectName(content,map);
						}
						break;
					case 1:
						// parseEducation(info,map,indexType,0);
						break;
					case 2:
						// parseJob(info,map,indexType,0);
						break;
					case 3:
						// parseProject(info,map,indexType,0);
						break;
					case 4:
						// parseMedal(info,map,indexType,0);
						break;
					case 5:
						// parseSkill(info,map,indexType,0);
						break;
					case 6:
						// parsePaper(info,map,indexType,0);
						break;
					case 7:
						// parsePatent(info,map,indexType,0);
						break;
					case 8:
						// parseComment(info,map,indexType,0);
						break;
					case 9:
						// parseExpectation(info,map,indexType,0);
						break;
					case 10:
						// parseOther(info,map,indexType,0);
						break;
					default:
						break;
					}
				}
			}
		}

	}

	/**
	 * 对简历进行分块 简历共分为11个信息域： Basic :个人信息 Education :教育背景 Job :工作经历 Project :项目经验
	 * Paper :校内奖励 Patent :专业技能 Medal :学术论文 Expectation :主要专利 Comment :自我评价
	 * Skill :求职意向 Other :其他信息
	 * 
	 */
	/// *
	public int getSeparationBehind(int id, int ownerid, int companyid, String content, IDatabaseDao dao)
			throws IOException {
		System.out.println("======================= getSeparationbehind =======================");
		CVObject map1 = new CVObject();
		boolean basicFlag = false;
		// 简历基本表
		CV cv = new CV();
		cv.setSource(1);
		cv.setUpdateTime(new Date());
		dao.insertCV(cv);
		int cvId = cv.getId();
		Map map = new HashMap<String, Integer>();
		map.put("candidateid", cvId);
		map.put("id", id);
		dao.updateCVFileCandidate(map);

		// cv.setId(cvId);
		cv.setCvFileId(id);
		cv.setCompanyId(companyid);
		cv.setOwnerId(ownerid);
		cv.setCv(content.trim());
		// 11个分块索引
		int iBasic, iEducation, iJob, iProject, iPaper, iPatent, iMedal, iExpectation, iComment, iSkill, iOther;
		iBasic = iEducation = iJob = iProject = iPaper = iPatent = iMedal = iExpectation = iComment = iSkill = iOther = 0;
		String text = content.replaceAll(" ", "");// 消除空格
		text = content.replaceAll(" ", "");
		text = transferCharacter(text);// 全角转半角
		// System.out.println("");
		// System.out.println("");
		// System.out.println("");
		System.out.println("--------原始简历begin------");
		System.out.println(text);
		System.out.println("--------原始简历end------");
		System.out.println("文本长度：" + text.length());
		// Ik分词
		StringReader sr = new StringReader(text);
		IKSegmenter ik = new IKSegmenter(sr, true);
		Lexeme lex = null;
		int[][] indexs = new int[2][100];// 存储11模块首个字符索引位置
		for (int i = 0; i < 100; i++) {
			indexs[0][i] = text.length();
		}
		indexs[0][0] = 0; // key
		indexs[1][0] = 100; // value
		int size = text.length();
		int ii = 0;
		int c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = 0, c6 = 0, c7 = 0, c8 = 0, c9 = 0, c10 = 0, c11 = 0;
		String str = "";
		while ((lex = ik.next()) != null) {
			// System.out.println(lex);
			if (m_UserDic.containsKey(lex.getLexemeText())) {
				// System.out.println("contains key");
				// System.out.println(m_UserDic.get(lex.getLexemeText()));
				int type = m_UserDic.get(lex.getLexemeText());
				switch (type) {
				case 100: // 基本信息
					iBasic = lex.getBeginPosition(); // 获取语义单元的起始字符在文本中的绝对位置
					indexs[0][ii] = iBasic;
					indexs[1][ii] = 100;
					ii++;
					break;
				case 101: // 教育经历
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iEducation = lex.getBeginPosition();
					indexs[0][ii] = iEducation;
					indexs[1][ii] = 101;
					ii++;
					break;
				case 102: // 工作经历
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iJob = lex.getBeginPosition();
					indexs[0][ii] = iJob;
					indexs[1][ii] = 102;
					ii++;
					break;
				case 103: // 项目经理
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iProject = lex.getBeginPosition();
					indexs[0][ii] = iProject;
					indexs[1][ii] = 103;
					ii++;
					break;
				case 104: // 奖励、校内活动
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iPaper = lex.getBeginPosition();
					indexs[0][ii] = iPaper;
					indexs[1][ii] = 104;
					ii++;
					break;
				case 105: // 技能特长
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iPatent = lex.getBeginPosition();
					indexs[0][ii] = iPatent;
					indexs[1][ii] = 105;
					ii++;
					break;
				case 106: // 论文专著
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iMedal = lex.getBeginPosition();
					indexs[0][ii] = iMedal;
					indexs[1][ii] = 106;
					ii++;
					break;
				case 107: // 专利
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iExpectation = lex.getBeginPosition();
					indexs[0][ii] = iExpectation;
					indexs[1][ii] = 107;
					ii++;
					break;
				case 108: // 自我评价
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iComment = lex.getBeginPosition();
					indexs[0][ii] = iComment;
					indexs[1][ii] = 108;
					ii++;
					break;
				case 109: // 求职意向
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iSkill = lex.getBeginPosition();
					indexs[0][ii] = iSkill;
					indexs[1][ii] = 109;
					ii++;
					break;
				case 110: // 其他
					if (ii == 0) {
						iBasic = 0;
						indexs[0][0] = iBasic;
						indexs[1][0] = 100;
						ii++;
					}
					iOther = lex.getBeginPosition();
					indexs[0][ii] = iOther;
					indexs[1][ii] = 110;
					ii++;
					break;
				default:
					break;
				}
			}
		}
		if (indexs[0][0] == text.length()) {
			iBasic = 0;
			indexs[0][0] = iBasic;
			indexs[1][0] = 100;
		}

		// 对分块进行排序
		insertsort(indexs);

		// for (int i = 0, len = indexs[0].length; i < len; i++) {
		// System.out.println(" " + indexs[0][i] + " type = " + indexs[1][i]);
		// }

		printArray(indexs);
		combineBlocks(text, indexs); // 简单获取各个板块信息，后面对空的有进一步处理
		insertsort(indexs);
		printArray(indexs);

		//
		for (int tempii = 0; tempii < 99; tempii++) {
			if (indexs[1][tempii] != 0) {
				for (int tempjj = tempii + 1; tempjj < 100; tempjj++) {
					if (indexs[1][tempjj] != 0) {
						// System.out.println("tempii number = " + tempii + "
						// tempii = "+indexs[1][tempii] + "tempjj number = " +
						// tempjj + " tempjj = " + indexs[1][tempjj]);
						if (indexs[1][tempii] == indexs[1][tempjj]) {
							indexs[0][tempjj] = text.length();
							indexs[1][tempjj] = 0;
							// break;
						} else {
							break;
						}
					}
				}
			}
		}
		printArray(indexs);

		insertsort(indexs);
		printArray(indexs);

		int[][] indexType = new int[2][11];// 存储11模块首个字符索引位置
		for (int i = 0; i < 11; i++) {
			indexType[0][i] = 0;
			indexType[1][i] = i;
			// System.out.println("type flag = "+indexType[0][i] + " type = " +
			// indexType[1][i]);
		}
		for (int i = 0; i < 100; i++) {
			switch (indexs[1][i]) {
			case 100:
				indexType[0][0] = 1;
				break;
			case 101:
				indexType[0][1] = 1;
				break;
			case 102:
				indexType[0][2] = 1;
				break;
			case 103:
				indexType[0][3] = 1;
				break;
			case 104:
				indexType[0][4] = 1;
				break;
			case 105:
				indexType[0][5] = 1;
				break;
			case 106:
				indexType[0][6] = 1;
				break;
			case 107:
				indexType[0][7] = 1;
				break;
			case 108:
				indexType[0][8] = 1;
				break;
			case 109:
				indexType[0][9] = 1;
				break;
			case 110:
				indexType[0][10] = 1;
				break;
			default:
				break;
			}
		}
		for (int i = 0; i < 11; i++) {
			// indexType[0][i] = 0;
			// indexType[1][i] = i;
			// System.out.println("type flag = "+indexType[0][i] + " type = " +
			// indexType[1][i]);
		}
		String strType = "";
		Pattern pGender = Pattern.compile("男|女");
		Pattern pAge = Pattern.compile("\\d{2}岁");
		Pattern pPhone = Pattern
				.compile("14\\d{9}|17\\d{9}|13\\d{9}|15\\d{9}|18\\d{9}|\\d{3,4}-\\d{4}-\\d{4}|\\d{3,4}-\\d{6,8}");
		Pattern pEmail = Pattern.compile("([0-9A-Za-z\\-_\\.]+)@([0-9A-Za-z]+\\.[A-Za-z]{2,3}(\\.[A-Za-z]{2})?)");
		Pattern pJobtime = Pattern.compile("\\d年工作经验|\\d年经验|\\d年以上工作经验|\\d年以上经验|\\d年|\\d年以上");
		Matcher matcher = pGender.matcher(content);
		Pattern pDegreeBen = Pattern.compile("本科|学士");
		Pattern pDegreeShuo = Pattern.compile("硕士|研究生");
		Pattern pDegreeBo = Pattern.compile("博士");
		Matcher matcherBen = pDegreeBen.matcher(content);
		while (matcherBen.find()) {
			degreeBehind = matcherBen.group();
			break;
		}
		Matcher matcherShuo = pDegreeShuo.matcher(content);
		while (matcherShuo.find()) {
			degreeBehind = matcherShuo.group();
			break;
		}
		Matcher matcherBo = pDegreeBo.matcher(content);
		while (matcherBo.find()) {
			degreeBehind = matcherBo.group();
			break;
		}
		while (matcher.find()) {
			genderBehind = matcher.group();
			break;
		}
		matcher = pAge.matcher(content);
		while (matcher.find()) {
			ageBehind = matcher.group();
			break;
		}
		matcher = pEmail.matcher(content);
		while (matcher.find()) {
			emailBehind = matcher.group();
			break;
		}
		matcher = pPhone.matcher(content);
		while (matcher.find()) {
			phoneBehind = matcher.group();
			break;
		}
		matcher = pJobtime.matcher(content);
		while (matcher.find()) {
			jobtimeBehind = matcher.group();
			break;
		}

		for (int i = 0, len = 100; i < len; i++) {
			String tempstr = "";
			// if (i == 10)
			if (i == 99) {
				strType = text.substring(indexs[0][i], text.length());
				tempstr = text.substring(0, text.length());
			} else {
				strType = text.substring(indexs[0][i], indexs[0][i + 1]);
				tempstr = text.substring(0, indexs[0][i + 1]);
			}
			switch (indexs[1][i]) {
			case 100:
				System.out.println("");
				System.out.println("Basic: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				if (strType.trim().length() <= 1024) {
					cv.setBasicInfo(strType.trim());
				}
				try {
					basicFlag = parseBasicBehind(cvId, ownerid, companyid, strType, dao, map1);
				} catch (Exception e) {
				}
				// System.out.println(map.getBasic().getName() == null ||
				// map.getBasic().getName().equals(""));
				// System.out.println("name = " + map.getBasic().getName());
				if (map1.getBasic() != null) {
					if (map1.getBasic().getName() == null || map1.getBasic().getName().equals("")) {
						detectName(strType, map1);
						// System.out.println("name = " +
						// map.getBasic().getName());
					}
					if (map1.getBasic().getName() == null || map1.getBasic().getName().equals("")) {
						map1.getBasic().setName("人才");
						// System.out.println("name = " +
						// map.getBasic().getName());
					}
				}
				// System.out.println(map.getBasic().getName());
				break;
			case 101:
				System.out.println("");
				System.out.println("Education: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// System.out.println("");
				if (strType.trim().length() <= 1024) {
					cv.setEducationInfo(strType.trim());
				}
				try {
					parseEducationBehind(cvId, strType, dao, map1);
				} catch (Exception e) {
				}
				break;
			case 102:
				System.out.println("");
				System.out.println("Job: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// System.out.println("");
				if (strType.trim().length() <= 1024) {
					cv.setJobInfo(strType.trim());
				}
				try {
					parseJobBehind(cvId, strType, dao, map1);
				} catch (Exception e) {
				}
				break;
			case 103:
				System.out.println("");
				System.out.println("Project: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// System.out.println("");
				if (strType.trim().length() <= 1024) {
					cv.setProjectInfo(strType.trim());
				}
				try {
					parseProjectBehind(cvId, strType, dao, map1);
				} catch (Exception e) {
				}
				break;
			case 104:
				System.out.println("");
				System.out.println("Medal: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// System.out.println("");
				if (strType.trim().length() <= 1024) {
					cv.setMedalInfo(strType.trim());
				}
				try {
					parseMedalBehind(cvId, strType, dao, map1);
				} catch (Exception e) {
				}
				break;
			case 105:
				System.out.println("");
				System.out.println("Skill: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// System.out.println("");
				if (strType.trim().length() <= 1024) {
					cv.setSkillInfo(strType.trim());
				}
				try {
					parseSkillBehind(cvId, strType, dao, map1);
				} catch (Exception e) {
				}
				break;
			case 106:
				System.out.println("");
				System.out.println("Paper: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// System.out.println("");
				if (strType.trim().length() <= 1024) {
					cv.setPaperInfo(strType.trim());
				}
				try {
					parsePaperBehind(cvId, strType, dao, map1);
				} catch (Exception e) {
				}
				break;
			case 107:
				System.out.println("");
				System.out.println("Patent: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// System.out.println("");
				if (strType.trim().length() <= 1024) {
					cv.setPatentInfo(strType.trim());
				}
				try {
					parsePatentBehind(cvId, strType, dao, map1);
				} catch (Exception e) {
				}
				break;
			case 108:
				System.out.println("");
				System.out.println("Comment: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// System.out.println("");
				if (strType.trim().length() <= 1024) {
					cv.setCommentInfo(strType.trim());
				}
				try {
					parseCommentBehind(cvId, strType, dao, map1);
				} catch (Exception e) {
				}
				break;
			case 109:
				System.out.println("");
				System.out.println("Expectation: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// System.out.println("");
				if (strType.trim().length() <= 1024) {
					cv.setExpectationInfo(strType.trim());
				}
				try {
					parseExpectationBehind(cvId, strType, dao, map1);
				} catch (Exception e) {
				}
				break;
			case 110:
				System.out.println("");
				System.out.println("Other: ");
				System.out.println("");
				System.out.println(strType);
				System.out.println("");
				// System.out.println("");
				if (strType.trim().length() <= 1024) {
					cv.setOtherInfo(strType.trim());
				}
				try {
					parseOtherBehind(cvId, strType, dao);
				} catch (Exception e) {
				}
				break;
			default:
				break;
			}
		}

		if (map1.getBasic() == null) {
			// System.out.println("basic == null");
			if (content.length() > 200) {
				parseGen(content.substring(0, 200), map1);
			} else {
				parseGen(content.substring(0, content.length()), map1);
			}

		}

		// 补全公司职位状态
		if (map1.getBasic() != null) {
			if (map1.getBasic().getCompany() == null || map1.getBasic().getCompany().equals("")) {
				int maxEndTime = 0;
				String tempCompany = null;
				// String tempTitle = null;
				if (map1.getJobs() != null) {
					for (Job jobOne : map1.getJobs()) {
						String tempEndTime = jobOne.getEndTime();
						tempEndTime = tempEndTime.trim();
						tempEndTime = tempEndTime.replaceAll("[\\pP\\p{Punct}]", "");
						if (Integer.parseInt(tempEndTime) == 101) {
							// System.out.println(Integer.parseInt(tempEndTime));
							tempCompany = jobOne.getCompany();
							// tempTitle = jobOne.getTitle();
							break;
						} else {
							if (Integer.parseInt(tempEndTime) > maxEndTime) {
								// System.out.println(Integer.parseInt(tempEndTime));
								maxEndTime = Integer.parseInt(tempEndTime);
								tempCompany = jobOne.getCompany();
								// tempTitle = jobOne.getTitle();
							}
						}

					}
					map1.getBasic().setCompany(tempCompany);
					if (map1.getBasic().getCompany().length() > 50) {
						map1.getBasic().setCompany(map1.getBasic().getCompany().substring(0, 49));
					}
				}
			}
			if (map1.getBasic().getTitle() == null || map1.getBasic().getTitle().equals("")) {
				int maxEndTime = 0;
				// String tempCompany = null;
				String tempTitle = null;
				if (map1.getJobs() != null) {
					for (Job jobOne : map1.getJobs()) {
						String tempEndTime = jobOne.getEndTime();
						tempEndTime = tempEndTime.trim();
						tempEndTime = tempEndTime.replaceAll("[\\pP\\p{Punct}]", "");
						if (Integer.parseInt(tempEndTime) == 101) {
							// System.out.println(Integer.parseInt(tempEndTime));
							// tempCompany = jobOne.getCompany();
							tempTitle = jobOne.getTitle();
							break;
						} else {
							if (Integer.parseInt(tempEndTime) > maxEndTime) {
								// System.out.println(Integer.parseInt(tempEndTime));
								maxEndTime = Integer.parseInt(tempEndTime);
								// tempCompany = jobOne.getCompany();
								tempTitle = jobOne.getTitle();
							}
						}

					}
					map1.getBasic().setTitle(tempTitle);
					if (map1.getBasic().getTitle().length() > 12) {
						map1.getBasic().setTitle(map1.getBasic().getTitle().substring(0, 11));
					}
				}
			}
		}

		// 补充期望职位期望城市期望薪资
		if (map1.getBasic() != null) {
			if (map1.getBasic().getExpectedJob() == null || map1.getBasic().getExpectedJob().equals("")) {
				if (map1.getExpectation() != null) {
					lex = null;
					String temp = "";
					sr = new StringReader(map1.getExpectation().getExpectationInfo());
					ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (m_UserDic.containsKey(temp)) {
							int type = m_UserDic.get(temp);
							switch (type) {
							case 14:
								map1.getBasic().setExpectedJob(temp);
								break;
							default:
								break;
							}
						}
						if (map1.getBasic().getExpectedJob() == null || map1.getBasic().getExpectedJob().equals("")) {
						} else {
							break;
						}
					}
				}
			}
			if (map1.getBasic().getExpectedCity() == null || map1.getBasic().getExpectedCity().equals("")) {
				if (map1.getExpectation() != null) {
					lex = null;
					String temp = "";
					sr = new StringReader(map1.getExpectation().getExpectationInfo());
					ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						temp = lex.getLexemeText();
						if (m_UserDic.containsKey(temp)) {
							int type = m_UserDic.get(temp);
							switch (type) {
							case 16:
								map1.getBasic().setExpectedCity(temp);
								break;
							default:
								break;
							}
						}
						if (map1.getBasic().getExpectedCity() == null || map1.getBasic().getExpectedCity().equals("")) {
						} else {
							break;
						}
					}
				}
			}
			if (map1.getBasic().getExpectedSalary().getId() == 67) {
				int yearOrmonth = 1;
				int maxSalary = 0;
				if (map1.getExpectation() != null) {
					lex = null;
					String temp = "";
					sr = new StringReader(map1.getExpectation().getExpectationInfo());
					ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (temp.equals("期望月薪") || temp.equals("月薪") || temp.equals("元/月") || temp.equals("元每月")
								|| temp.equals("每月")) {
							yearOrmonth = 1;
							break;
						} else if (temp.equals("期望年薪") || temp.equals("年薪") || temp.equals("元/年") || temp.equals("元每年")
								|| temp.equals("每年") || temp.equals("年")) {
							yearOrmonth = 2;
							break;
						}
					}
					if (yearOrmonth == 1) {
						// month
						Pattern pattern1 = Pattern.compile("\\d{4,6}");
						Matcher matcher1 = pattern1.matcher(map1.getExpectation().getExpectationInfo());
						while (matcher1.find()) {
							if (Integer.parseInt(matcher1.group()) > maxSalary) {
								maxSalary = Integer.parseInt(matcher1.group());
							}
						}
						if (maxSalary == 0) {
							lex = null;
							temp = "";
							sr = new StringReader(map1.getExpectation().getExpectationInfo());
							ik = new IKSegmenter(sr, true);
							while ((lex = ik.next()) != null) {
								temp = lex.getLexemeText();
								if (temp.contains("万") || temp.contains("w") || temp.contains("W")) {
									pattern1 = Pattern.compile("\\d{1,3}");
									matcher1 = pattern1.matcher(temp);
									while (matcher1.find()) {
										if (Integer.parseInt(matcher1.group()) * 10000 > maxSalary) {
											maxSalary = Integer.parseInt(matcher1.group()) * 10000;
										}
									}
								}
							}
						}
						if (maxSalary == 0) {
							lex = null;
							temp = "";
							sr = new StringReader(map1.getExpectation().getExpectationInfo());
							ik = new IKSegmenter(sr, true);
							while ((lex = ik.next()) != null) {
								temp = lex.getLexemeText();
								if (temp.contains("k")) {
									pattern1 = Pattern.compile("\\d{1,3}");
									matcher1 = pattern1.matcher(temp);
									while (matcher1.find()) {
										if (Integer.parseInt(matcher1.group()) * 1000 > maxSalary) {
											maxSalary = Integer.parseInt(matcher1.group()) * 1000;
										}
									}
								}
							}
						}
						maxSalary = maxSalary * 12;
					} else if (yearOrmonth == 2) {
						// year
						Pattern pattern1 = Pattern.compile("\\d{4,7}");
						Matcher matcher1 = pattern1.matcher(map1.getExpectation().getExpectationInfo());
						while (matcher1.find()) {
							if (Integer.parseInt(matcher1.group()) > maxSalary) {
								maxSalary = Integer.parseInt(matcher1.group());
							}
						}
						if (maxSalary == 0) {
							lex = null;
							temp = "";
							sr = new StringReader(map1.getExpectation().getExpectationInfo());
							ik = new IKSegmenter(sr, true);
							while ((lex = ik.next()) != null) {
								temp = lex.getLexemeText();
								if (temp.contains("万") || temp.contains("w") || temp.contains("W")) {
									pattern1 = Pattern.compile("\\d{1,3}");
									matcher1 = pattern1.matcher(temp);
									while (matcher1.find()) {
										if (Integer.parseInt(matcher1.group()) * 10000 > maxSalary) {
											maxSalary = Integer.parseInt(matcher1.group()) * 10000;
										}
									}
								}
							}
						}
						if (maxSalary == 0) {
							lex = null;
							temp = "";
							sr = new StringReader(map1.getExpectation().getExpectationInfo());
							ik = new IKSegmenter(sr, true);
							while ((lex = ik.next()) != null) {
								temp = lex.getLexemeText();
								if (temp.contains("k")) {
									pattern1 = Pattern.compile("\\d{1,3}");
									matcher1 = pattern1.matcher(temp);
									while (matcher1.find()) {
										if (Integer.parseInt(matcher1.group()) * 1000 > maxSalary) {
											maxSalary = Integer.parseInt(matcher1.group()) * 1000;
										}
									}
								}
							}
						}
					}
				}
				// System.out.println("maxSalary = " + maxSalary);

				if (maxSalary <= 0) {
					map1.getBasic().getExpectedSalary().setId(148);
				} else if (maxSalary > 0 && maxSalary < 50000) {
					map1.getBasic().getExpectedSalary().setId(67);
				} else if (maxSalary >= 50000 && maxSalary < 100000) {
					map1.getBasic().getExpectedSalary().setId(68);
				} else if (maxSalary >= 100000 && maxSalary < 200000) {
					map1.getBasic().getExpectedSalary().setId(69);
				} else if (maxSalary >= 200000 && maxSalary < 300000) {
					map1.getBasic().getExpectedSalary().setId(70);
				} else if (maxSalary >= 300000 && maxSalary < 500000) {
					map1.getBasic().getExpectedSalary().setId(71);
				} else if (maxSalary >= 500000 && maxSalary < 1000000) {
					map1.getBasic().getExpectedSalary().setId(72);
				} else if (maxSalary >= 1000000) {
					map1.getBasic().getExpectedSalary().setId(73);
				}
			}
		}
		/*
		 * System.out.println("================ expectation =================="
		 * ); System.out.println("expected job = " +
		 * map1.getBasic().getExpectedJob()); System.out.println(
		 * "expected city = " + map1.getBasic().getExpectedCity());
		 * System.out.println("expected salary = " +
		 * map1.getBasic().getExpectedSalary()); System.out.println(
		 * "================ expectation end ==================");
		 */

		// 补充工作年限
		if (map1.getBasic() != null) {
			if (true) {
				int maxJobTime = 0;
				int minJobTime = 3000;
				if (map1.getJobs() != null)
					for (Job jobOne : map1.getJobs()) {
						// System.out.println("start time = " +
						// jobOne.getStartTime());
						// System.out.println("end time = " +
						// jobOne.getEndTime());
						Pattern pattern1 = Pattern.compile(
								"((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))|(0000)");
						Matcher matcher1 = pattern1.matcher(jobOne.getStartTime());
						while (matcher1.find()) {
							// System.out.println(Integer.parseInt(matcher1.group()));
							if (Integer.parseInt(matcher1.group()) < minJobTime) {
								minJobTime = Integer.parseInt(matcher1.group());
							}
						}
						pattern1 = Pattern.compile(
								"((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))|(0000)");
						matcher1 = pattern1.matcher(jobOne.getEndTime());
						while (matcher1.find()) {
							// System.out.println(Integer.parseInt(matcher1.group()));
							if (Integer.parseInt(matcher1.group()) == 0) {
								Calendar a = Calendar.getInstance();
								// System.out.println("current year = " +
								// a.get(Calendar.YEAR));
								maxJobTime = a.get(Calendar.YEAR);
							} else {
								if (Integer.parseInt(matcher1.group()) > maxJobTime) {
									maxJobTime = Integer.parseInt(matcher1.group());
								}
							}
						}
					}
				// System.out.println("max time = " + maxJobTime);
				// System.out.println("min time = " + minJobTime);
				if (maxJobTime > minJobTime) {
					Long longJobTime = new Long((long) (maxJobTime - minJobTime));
					map1.getBasic().setJob_time(longJobTime);
				}
			}
		}

		// 补充教育经历
		int maxTime = 0;
		if (map1.getEducations() != null)
			for (EducationNow education : map1.getEducations()) {
				if (education.getDegree().getId() > map1.getBasic().getDegree().getId()) {
					// System.out.println(">");
					map1.getBasic().setDegree(education.getDegree());
					map1.getBasic().setSchool(education.getSchool());
					if (map1.getBasic().getSchool().length() > 22) {
						map1.getBasic().setSchool(map1.getBasic().getSchool().substring(0, 21));
					}
					map1.getBasic().setMajor(education.getMajor());
					// System.out.println(map.getBasic().getMajor());
					// System.out.println(map.getBasic().getDegree());
					// System.out.println(map.getBasic().getSchool());
				} else if (education.getDegree().getId() == map1.getBasic().getDegree().getId()) {
					// System.out.println(education.getEndTime());
					Pattern pattern1 = Pattern.compile("((19\\d{2}|20\\d{2}))|(0000)");
					Matcher matcher1 = pattern1.matcher(education.getEndTime());
					// System.out.println("endTime = " +
					// education.getEndTime());
					while (matcher1.find()) {
						String strstr = matcher1.group();
						int tempTime = Integer.parseInt(strstr);
						// System.out.println("tempTime = " + tempTime);
						if (tempTime == 0) {
							Calendar a = Calendar.getInstance();
							tempTime = a.get(Calendar.YEAR);
						}
						if (tempTime > maxTime) {
							map1.getBasic().setDegree(education.getDegree());
							map1.getBasic().setSchool(education.getSchool());
							if (map1.getBasic().getSchool().length() > 22) {
								map1.getBasic().setSchool(map1.getBasic().getSchool().substring(0, 21));
							}
							map1.getBasic().setMajor(education.getMajor());
							maxTime = tempTime;
						}
					}
				}
			}

		/// *
		Basic basic = new Basic();
		basic.setUpdateTime(new Date());
		basic.setOwnerid(ownerid);
		basic.setCompany_id(companyid);
		basic.setFileid(id);
		map1.getBasic().setName(map1.getBasic().getName().replaceAll("\\s+", ""));
		basic.setName(map1.getBasic().getName());
		// System.out.println("");
		// System.out.println("");
		// System.out.println("=========" + basic.getName() + "==========");
		if (map1.getBasic().getName() == null || map1.getBasic().getName().equals("")) {
			// System.out.println("==============================================================");
			basic.setName("人才");
		}
		// System.out.println("");
		// System.out.println("");
		// System.out.println("=========" + basic.getName() + "==========");
		// System.out.println("");
		// System.out.println("");
		basic.setPhotoId(0);
		basic.setMpc(0);
		basic.setAge(getAgeNum(ageBehind));
		basic.setGender(genderBehind.equals("女") ? 2 : 0);
		basic.setGender(genderBehind.equals("男") ? 1 : 0);
		basic.setEmail(emailBehind);
		phoneBehind = phoneBehind.replaceAll("-", "");
		// System.out.println("--------------- " + phoneBehind + "
		// ----------------");
		basic.setMobile(phoneBehind);
		// basic.setJob_time(map1.getBasic().getJob_time());
		if (map1.getBasic().getJob_time() < 1) {
			basic.setJobTime("102");
		} else if (map1.getBasic().getJob_time() >= 1 && map1.getBasic().getJob_time() < 3) {
			basic.setJobTime("103");
		} else if (map1.getBasic().getJob_time() >= 3 && map1.getBasic().getJob_time() < 5) {
			basic.setJobTime("104");
		} else if (map1.getBasic().getJob_time() >= 5 && map1.getBasic().getJob_time() < 10) {
			basic.setJobTime("11");
		} else if (map1.getBasic().getJob_time() >= 10) {
			basic.setJobTime("12");
		}
		// basic.setJobTime(map1.getBasic().getJob_time() + "");
		basic.setCandidateId(cvId);
		if (degreeBehind.contains("本科") || degreeBehind.contains("学士")) {
			degreeBehind = "4";
		} else if (degreeBehind.contains("专科") || degreeBehind.contains("大专")) {
			degreeBehind = "3";
		} else if (degreeBehind.contains("硕士") || degreeBehind.contains("研究生")) {
			degreeBehind = "5";
		} else if (degreeBehind.contains("博士")) {
			degreeBehind = "6";
		} else if (degreeBehind.contains("博士后")) {
			degreeBehind = "7";
		} else {
			degreeBehind = "0";
		}
		basic.setJob_time(map1.getBasic().getJob_time());
		basic.setDegree(map1.getBasic().getDegree().getId() + "");
		basic.setAddress(map1.getBasic().getAddress());
		basic.setBasicInfo(map1.getBasic().getBasicInfo());
		basic.setBirthday(map1.getBasic().getBirthday());
		basic.setBirthPlace(map1.getBasic().getBirthPlace());
		basic.setBwh(map1.getBasic().getBwh());
		basic.setCity(map1.getBasic().getCity());
		basic.setCompany(map1.getBasic().getCompany());
		if (basic.getCompany().length() > 50) {
			basic.setCompany(basic.getCompany().substring(0, 49));
		}
		basic.setCountry(map1.getBasic().getCountry());
		basic.setCurrentSalary(map1.getBasic().getCurrentSalary());
		basic.setEnglishName(map1.getBasic().getEnglishName());
		basic.setExpectedCity(map1.getBasic().getExpectedCity());
		basic.setExpectedJob(map1.getBasic().getExpectedJob());
		basic.setExpectedSalary(map1.getBasic().getExpectedSalary().getId());
		/*
		 * System.out.println("================ expectation =================="
		 * ); System.out.println("expected job = " + basic.getExpectedJob());
		 * System.out.println("expected city = " + basic.getExpectedCity());
		 * System.out.println("expected salary = " + basic.getExpectedSalary());
		 * System.out.println(
		 * "================ expectation end ==================");
		 */
		basic.setHealth(map1.getBasic().getHealth());
		basic.setHeight(map1.getBasic().getHeight());
		basic.setIdCard(map1.getBasic().getIdCard());
		basic.setJobStatus(map1.getBasic().getJobStatus().getId());
		basic.setMajor(map1.getBasic().getMajor());
		basic.setMarriage(map1.getBasic().getMarriage());
		// basic.setName(map1.getBasic().getName());
		basic.setNationality(map1.getBasic().getNationality());
		basic.setPhone(map1.getBasic().getPhone());
		basic.setPolitics(map1.getBasic().getPolitics());
		basic.setQq(map1.getBasic().getQq());
		basic.setSchool(map1.getBasic().getSchool());
		if (basic.getSchool().length() > 22) {
			basic.setSchool(basic.getSchool().substring(0, 21));
		}
		basic.setTitle(map1.getBasic().getTitle());
		if (basic.getTitle().length() > 12) {
			basic.setTitle(basic.getTitle().substring(0, 11));
		}
		basic.setUsedName(map1.getBasic().getUsedName());
		basic.setWeight(map1.getBasic().getWeight());
		basic.setOwnerid(ownerid);
		basic.setCompany_id(companyid);
		basic.setProcessStage(0);
		basic.setUpdateTime(new Date());
		dao.insertBasic(basic);

		System.out.println("-----123456---" + basic);
		// */

		basicFlag = false;
		cv.setOwnerId(ownerid);
		cv.setCompanyId(companyid);
		cv.setUpdateTime(new Date());
		cv.setCvFileId(id);
		dao.updateCVById(cv);
		cv = null;
		dao.updateCVFileFlag(id);

		degreeBehind = "";
		genderBehind = "";
		ageBehind = "";
		emailBehind = "";
		phoneBehind = "";
		jobtimeBehind = "";

		return 0;
	}
	// */

	/**
	 * 对简历进行分块 简历共分为11个信息域： Basic :个人信息 Education :教育背景 Job :工作经历 Project :项目经验
	 * Paper :校内奖励 Patent :专业技能 Medal :学术论文 Expectation :主要专利 Comment :自我评价
	 * Skill :求职意向 Other :其他信息
	 * 
	 */
	/*
	 * public int getSeparationBehind(int id,int ownerid,int companyid,String
	 * content,IDatabaseDao dao) throws IOException { //CVObject map1 = new
	 * CVObject(); boolean basicFlag = false; //简历基本表 CV cv = new CV();
	 * cv.setSource(1); cv.setUpdateTime(new Date()); dao.insertCV(cv); int cvId
	 * = cv.getId(); Map map = new HashMap<String,Integer>();
	 * map.put("candidateid", cvId); map.put("id", id);
	 * dao.updateCVFileCandidate(map);
	 * 
	 * //cv.setId(cvId); cv.setCvFileId(id); cv.setCompanyId(companyid);
	 * cv.setOwnerId(ownerid); cv.setCv(content.trim()); //11个分块索引 int iBasic,
	 * iEducation, iJob, iProject, iPaper, iPatent, iMedal, iExpectation,
	 * iComment, iSkill, iOther; iBasic = iEducation = iJob = iProject = iPaper
	 * = iPatent = iMedal = iExpectation = iComment = iSkill = iOther = 0;
	 * String text = content.replaceAll(" ", "");// 消除空格 //Ik分词 StringReader sr
	 * = new StringReader(text); IKSegmenter ik = new IKSegmenter(sr, true);
	 * Lexeme lex = null; int[][] indexs = new int[2][11];// 存储11模块首个字符索引位置 int
	 * size = text.length(); int c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = 0, c6 = 0,
	 * c7 = 0, c8 = 0, c9 = 0, c10 = 0, c11 = 0; String str = ""; while ((lex =
	 * ik.next()) != null) { if (m_UserDic.containsKey(lex.getLexemeText())) {
	 * int type = m_UserDic.get(lex.getLexemeText()); switch (type) { case 100:
	 * if (c1 == 0) { iBasic = lex.getBeginPosition(); indexs[0][0] = iBasic;
	 * indexs[1][0] = 100; c1++; } break; case 101: if (c2 == 0) { iEducation =
	 * lex.getBeginPosition(); indexs[0][1] = iEducation; indexs[1][1] = 101;
	 * c2++; } break; case 102: if (c3 == 0) { iJob = lex.getBeginPosition();
	 * indexs[0][2] = iJob; indexs[1][2] = 102; c3++; } break; case 103: if (c4
	 * == 0) { iProject = lex.getBeginPosition(); indexs[0][3] = iProject;
	 * indexs[1][3] = 103; c4++; } break; case 104: if (c5 == 0) { iPaper =
	 * lex.getBeginPosition(); indexs[0][4] = iPaper; indexs[1][4] = 104; c5++;
	 * } break; case 105:
	 * 
	 * if (c6 == 0) { iPatent = lex.getBeginPosition(); indexs[0][5] = iPatent;
	 * indexs[1][5] = 105; c6++; } break; case 106: if (c7 == 0) { iMedal =
	 * lex.getBeginPosition(); indexs[0][6] = iMedal; indexs[1][6] = 106; c7++;
	 * } break; case 107: if (c8 == 0) { iExpectation = lex.getBeginPosition();
	 * indexs[0][7] = iExpectation; indexs[1][7] = 107; c8++; }
	 * 
	 * break; case 108: if (c9 == 0) { iComment = lex.getBeginPosition();
	 * indexs[0][8] = iComment; indexs[1][8] = 108; c9++; } break; case 109: if
	 * (c10 == 0) { iSkill = lex.getBeginPosition(); indexs[0][9] = iSkill;
	 * indexs[1][9] = 109; c10++; } break; case 110: if (c11 == 0) { iOther =
	 * lex.getBeginPosition(); indexs[0][10] = iOther; indexs[1][10] = 110;
	 * c11++; } break; default: break; } } } // 对分块进行排序 insertsort(indexs);
	 * for(int i = 0, len = indexs[0].length; i < len; i++) { System.out.print(
	 * "   "+indexs[0][i]); } String strType = ""; Pattern pGender =
	 * Pattern.compile("男|女"); Pattern pAge = Pattern.compile("\\d{2}岁");
	 * Pattern pPhone = Pattern.compile(
	 * "14\\d{9}|17\\d{9}|13\\d{9}|15\\d{9}|18\\d{9}|\\d{3,4}-\\d{4}-\\d{4}|\\d{3,4}-\\d{6,8}"
	 * ); Pattern pEmail = Pattern.compile(
	 * "([0-9A-Za-z\\-_\\.]+)@([0-9A-Za-z]+\\.[A-Za-z]{2,3}(\\.[A-Za-z]{2})?)");
	 * Pattern pJobtime =
	 * Pattern.compile("\\d年工作经验|\\d年经验|\\d年以上工作经验|\\d年以上经验|\\d年"); Matcher
	 * matcher = pGender.matcher(content); Pattern pDegreeBen =
	 * Pattern.compile("本科|学士"); Pattern pDegreeShuo =
	 * Pattern.compile("硕士|研究生"); Pattern pDegreeBo = Pattern.compile("博士");
	 * Matcher matcherBen = pDegreeBen.matcher(content); while
	 * (matcherBen.find()) { degreeBehind = matcherBen.group(); break; } Matcher
	 * matcherShuo = pDegreeShuo.matcher(content); while (matcherShuo.find()) {
	 * degreeBehind = matcherShuo.group(); break; } Matcher matcherBo =
	 * pDegreeBo.matcher(content); while (matcherBo.find()) { degreeBehind =
	 * matcherBo.group(); break; } while (matcher.find()) { genderBehind =
	 * matcher.group(); break; } matcher = pAge.matcher(content); while
	 * (matcher.find()) { ageBehind = matcher.group(); break; } matcher =
	 * pEmail.matcher(content); while (matcher.find()) { emailBehind =
	 * matcher.group(); break; } matcher = pPhone.matcher(content); while
	 * (matcher.find()) { phoneBehind = matcher.group(); break; } matcher =
	 * pJobtime.matcher(content); while (matcher.find()) { jobtimeBehind =
	 * matcher.group(); break; } for (int i = 0, len = indexs[0].length; i <
	 * len; i++) { if (i == 10) { strType = text.substring(indexs[0][i],
	 * text.length()); } else { strType = text.substring(indexs[0][i],
	 * indexs[0][i + 1]); } switch (indexs[1][i]) { case 100:
	 * if(strType.trim().length()<=1024){ cv.setBasicInfo(strType.trim()); } try
	 * { basicFlag =parseBasicBehind(cvId,ownerid,companyid,strType,dao); }
	 * catch (Exception e) { } break; case 101:
	 * if(strType.trim().length()<=1024){ cv.setEducationInfo(strType.trim()); }
	 * try { parseEducationBehind(cvId,strType,dao); } catch (Exception e) { }
	 * 
	 * break; case 102: if(strType.trim().length()<=1024){
	 * cv.setJobInfo(strType.trim()); }
	 * 
	 * try { parseJobBehind(cvId,strType,dao); } catch (Exception e) { }
	 * 
	 * break; case 103: if(strType.trim().length()<=1024){
	 * cv.setProjectInfo(strType.trim()); }
	 * 
	 * try { parseProjectBehind(cvId,strType,dao); } catch (Exception e) { }
	 * 
	 * break; case 104: if(strType.trim().length()<=1024){
	 * cv.setMedalInfo(strType.trim()); }
	 * 
	 * try { parseMedalBehind(cvId,strType,dao); } catch (Exception e) { }
	 * 
	 * break; case 105: if(strType.trim().length()<=1024){
	 * cv.setSkillInfo(strType.trim()); }
	 * 
	 * try { parseSkillBehind(cvId,strType,dao); } catch (Exception e) { }
	 * 
	 * break; case 106: if(strType.trim().length()<=1024){
	 * cv.setPaperInfo(strType.trim()); }
	 * 
	 * try { parsePaperBehind(cvId,strType,dao); } catch (Exception e) { }
	 * 
	 * break; case 107: if(strType.trim().length()<=1024){
	 * cv.setPatentInfo(strType.trim()); }
	 * 
	 * try { parsePatentBehind(cvId,strType,dao); } catch (Exception e) { }
	 * break; case 108: if(strType.trim().length()<=1024){
	 * cv.setCommentInfo(strType.trim()); } try {
	 * parseCommentBehind(cvId,strType,dao); } catch (Exception e) { } break;
	 * case 109: if(strType.trim().length()<=1024){
	 * cv.setExpectationInfo(strType.trim()); }
	 * 
	 * try { parseExpectationBehind(cvId,strType,dao); } catch (Exception e) { }
	 * 
	 * break; case 110: if(strType.trim().length()<=1024){
	 * cv.setOtherInfo(strType.trim()); } try {
	 * parseOtherBehind(cvId,strType,dao); } catch (Exception e) { }
	 * 
	 * break; default: break; } } if(!basicFlag) { Basic basic = new Basic();
	 * basic.setUpdateTime(new Date()); basic.setOwnerid(ownerid);
	 * basic.setCompany_id(companyid); basic.setFileid(id); basic.setName("人才");
	 * basic.setPhotoId(0); basic.setMpc(0); basic.setAge(ageBehind);
	 * basic.setGender(genderBehind.equals("女")?2:1);
	 * basic.setEmail(emailBehind); basic.setMobile(phoneBehind);
	 * basic.setJobTime(jobtimeBehind); basic.setCandidateId(cvId);
	 * if(degreeBehind.contains("本科")||degreeBehind.contains("学士")) {
	 * degreeBehind = "4"; }else
	 * if(degreeBehind.contains("专科")||degreeBehind.contains("大专")){
	 * degreeBehind = "3"; }else
	 * if(degreeBehind.contains("硕士")||degreeBehind.contains("研究生")){
	 * degreeBehind = "5"; }else if(degreeBehind.contains("博士")){ degreeBehind =
	 * "6"; }else if(degreeBehind.contains("博士后")){ degreeBehind = "7"; }else{
	 * degreeBehind = "0"; } basic.setDegree(degreeBehind);
	 * basic.setOwnerid(ownerid); basic.setCompany_id(companyid);
	 * basic.setProcessStage(0); basic.setUpdateTime(new Date());
	 * dao.insertBasic(basic); } basicFlag = false; cv.setOwnerId(ownerid);
	 * cv.setCompanyId(companyid); cv.setUpdateTime(new Date());
	 * cv.setCvFileId(id); dao.updateCVById(cv); cv = null;
	 * dao.updateCVFileFlag(id);
	 * 
	 * degreeBehind = "" ; genderBehind = ""; ageBehind = ""; emailBehind = "";
	 * phoneBehind = ""; jobtimeBehind = "" ; return 0; } //
	 */

	/**
	 * @param indexs
	 */
	private void printArray(int[][] indexs) {
		System.out.println("----------------------------");
		// int[][] indexs = new int[4][100];// 存储11模块首个字符索引位置
		for (int i = 0; i < indexs.length; i++) {
			for (int j = 0; j < indexs[i].length; j++) {
				System.out.print(indexs[i][j] + "\t");
			}
			System.out.println();
		}

	}

	/**
	 * 解析其他信息模块
	 * 
	 * @param info
	 * @param map
	 */
	private void parseOtherBehind(int id, String info, IDatabaseDao dao) {

	}

	/**
	 * 函数名：parseSkill() 功 能：识别技能信息块的内容
	 * 
	 * @throws IOException
	 */
	/// *
	private void parseSkillBehind(int id, String info, IDatabaseDao dao, CVObject map) throws IOException {
		System.out.println("===============parse skill behind================");
		List<Skill> skills = new ArrayList<Skill>();
		if (map.getSkills() != null) {
			skills = map.getSkills();
		}
		info = info.replaceAll("||    ||||", "");
		// System.out.println(info);
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<Medal> mList = new ArrayList<Medal>();
		// 解析IT技能
		Pattern pattern = Pattern.compile("精通|熟悉|了解|熟练|一般|良好");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());
		}
		for (int i = 0, len = iList.size(); i < len; i++) {
			if (i == len - 1) {
				// System.out.println(info.substring(iList.get(i),
				// info.length()));
				// System.out.println("=============== i == len - 1
				// ================");
				Lexeme lex = null;
				StringReader sr = new StringReader(info.substring(iList.get(i), info.length()));
				IKSegmenter ik = new IKSegmenter(sr, true);
				StringBuilder sSkillName = new StringBuilder();
				String str = "";
				while ((lex = ik.next()) != null) {
					String tmp = "";
					tmp = lex.getLexemeText();
					// System.out.println(tmp);
					if (m_UserDic.containsKey(tmp)) {
						if (m_UserDic.get(tmp) == 17 || m_UserDic.get(tmp) == 13) {
							int tmpflag = 1;
							for (Skill skillOne : skills) {
								if (skillOne.getSkillName().equals(tmp)) {
									tmpflag = 0;
									break;
								}
							}
							if (tmpflag == 1) {
								Skill skill = new Skill();
								skill.setSkillName(tmp);
								skill.setInfo(info.substring(iList.get(i), info.length()));
								if (skill.getInfo().length() > 1000) {
									skill.setInfo(skill.getInfo().substring(0, 999));
								}
								skill.setSkillInfo(sList.get(i));
								skills.add(skill);
								skill.setCandidateid(id);
								skill.setUpdateTime(new Date());
								int rows = dao.insertSkill(skill);
								// System.out.println("================= rows
								// ===================");
								skill = null;
								// System.out.println("skill name = " +
								// skill.getSkillName() + " level = " +
								// skill.getSkillInfo());
							}
						}
					}
				}
			} else {
				// System.out.println(info.substring(iList.get(i),
				// iList.get(i+1)));
				// System.out.println("=============== i < len - 1
				// ================");
				Lexeme lex = null;
				StringReader sr = new StringReader(info.substring(iList.get(i), iList.get(i + 1)));
				IKSegmenter ik = new IKSegmenter(sr, true);
				StringBuilder sSkillName = new StringBuilder();
				String str = "";
				try {
					while ((lex = ik.next()) != null) {
						String tmp = "";
						tmp = lex.getLexemeText();
						// System.out.println(tmp);
						if (m_UserDic.containsKey(tmp)) {
							// System.out.println("=============== find tmp
							// ================");
							if (m_UserDic.get(tmp) == 17) {
								// System.out.println("=============== tmp == 17
								// ================");
								int tmpflag = 1;
								for (Skill skillOne : skills) {
									if (skillOne.getSkillName().equals(tmp)) {
										// System.out.println("===============
										// tmpflag == 0 ================");
										tmpflag = 0;
										break;
									}
								}
								if (tmpflag == 1) {
									Skill skill = new Skill();
									skill.setSkillName(tmp);
									skill.setInfo(info.substring(iList.get(i), iList.get(i + 1)));
									if (skill.getInfo().length() > 1000) {
										skill.setInfo(skill.getInfo().substring(0, 999));
									}
									skill.setSkillInfo(sList.get(i));
									skills.add(skill);
									skill.setCandidateid(id);
									skill.setUpdateTime(new Date());
									System.out.println("map skill = " + skill.getInfo());
									// System.out.println("=================
									// before insert 123 ===================");
									dao.insertSkill(skill);
									// System.out.println("=================
									// rows ===================");
									skill = null;
									// System.out.println("skill name = " +
									// skill.getSkillName() + " level = " +
									// skill.getSkillInfo());
								}
							}
						}
					}
				} catch (IOException e) {
					// System.out.println("============= error =============");
					e.printStackTrace();
					// System.out.println(e);
				}
			}
		}
		if (iList.size() == 0) {
			// System.out.println("=============== size == 0 ================");
			Lexeme lex = null;
			StringReader sr = new StringReader(info);
			IKSegmenter ik = new IKSegmenter(sr, true);
			StringBuilder sSkillName = new StringBuilder();
			String str = "";
			try {
				while ((lex = ik.next()) != null) {
					String tmp = "";
					// sSkillName.delete(0, sSkillName.length());
					tmp = lex.getLexemeText();
					// System.out.println(tmp);
					if (m_UserDic.containsKey(tmp)) {
						if (m_UserDic.get(tmp) == 17 || m_UserDic.get(tmp) == 13) {
							Skill skill = new Skill();
							skill.setSkillName(tmp);
							skill.setInfo(info.trim());
							if (skill.getInfo().length() > 1000) {
								skill.setInfo(skill.getInfo().substring(0, 999));
							}
							skill.setSkillInfo("");
							skills.add(skill);
							skill.setCandidateid(id);
							skill.setUpdateTime(new Date());
							int rows = dao.insertSkill(skill);
							// System.out.println("================= rows
							// ===================");
							skill = null;
							// map.setSkills(skills);
						}
					}
				}
			} catch (IOException e) {
				// System.out.println("============= error =============");
				e.printStackTrace();
				// System.out.println(e);
			}
		}

		// 解析英语技能

		map.setSkills(skills);
		for (Skill skillOne : map.getSkills()) {
			// System.out.println("map skillOne = " + skillOne.getInfo());
		}
		// skill = null;
	}
	// */

	/*
	 * private void parseSkillBehind(int id ,String info,IDatabaseDao dao) {
	 * Lexeme lex = null; StringReader sr = new StringReader(info); IKSegmenter
	 * ik = new IKSegmenter(sr, true); StringBuilder sSkillName = new
	 * StringBuilder(); String str = ""; try { while ((lex = ik.next()) != null)
	 * { String tmp = ""; tmp = lex.getLexemeText(); if
	 * (m_UserDic.containsKey(tmp)) { if (m_UserDic.get(tmp) == 0)
	 * sSkillName.append(tmp +"  "); } } } catch (IOException e) {
	 * e.printStackTrace(); } Skill skill = new Skill();
	 * skill.setSkillName(sSkillName.toString()); skill.setInfo(info.trim());
	 * skill.setSkillInfo(info.trim()); skill.setCandidateid(id);
	 * skill.setUpdateTime(new Date()); dao.insertSkill(skill); skill = null; }
	 * //
	 */

	/**
	 * 函数名：parseComment() * 功 能：识别自我评价信息块的内容
	 */
	/// *
	private void parseCommentBehind(int id, String info, IDatabaseDao dao, CVObject map) {
		info = info.replaceAll("||    |||", "");
		Lexeme lex = null;
		StringReader sr = new StringReader(info);
		IKSegmenter ik = new IKSegmenter(sr, true);
		String str = "";
		try {
			while ((lex = ik.next()) != null) {
				String tmp = "";
				tmp = lex.getLexemeText();
				if (m_UserDic.containsKey(tmp)) {
					if (m_UserDic.get(tmp) == 108) {
						str = tmp;
						info = info.replaceFirst(tmp, "");
					}
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		Comment comment = new Comment();
		if (info.trim().length() < 500) {
			comment.setInfo(info.trim());
			comment.setCommentInfo(info.trim());
		}
		List<Comment> comments = new ArrayList<Comment>();
		if (map.getComments() != null) {
			comments = map.getComments();
		}
		comments.add(comment);
		map.setComments(comments);
		comment.setCandidateid(id);
		comment.setUpdateTime(new Date());
		dao.insertComment(comment);
		comment = null;
	}
	// */

	/*
	 * private void parseCommentBehind(int id ,String info,IDatabaseDao dao) {
	 * Lexeme lex = null; StringReader sr = new StringReader(info); IKSegmenter
	 * ik = new IKSegmenter(sr, true); String str = ""; try { while ((lex =
	 * ik.next()) != null) { String tmp = ""; tmp = lex.getLexemeText(); if
	 * (m_UserDic.containsKey(tmp)) { if (m_UserDic.get(tmp) == 108) str = tmp;
	 * } } } catch (IOException e) { e.printStackTrace(); } Comment comment =
	 * new Comment(); if(info.trim().length()<500) {
	 * comment.setCommentInfo(info.trim()); comment.setInfo(info.trim()); }
	 * comment.setCandidateid(id); comment.setUpdateTime(new Date());
	 * dao.insertComment(comment); comment = null ; } //
	 */

	/**
	 * 函数名：parseExpectationl() 功 能：识别求职期望信息块的内容
	 */
	/// *
	private void parseExpectationBehind(int id, String info, IDatabaseDao dao, CVObject map) throws IOException {
		info = info.replaceAll("||    |||", "");
		Lexeme lex = null;
		StringReader sr = new StringReader(info);
		IKSegmenter ik = new IKSegmenter(sr, true);
		StringBuilder str = new StringBuilder();
		int count = 0;
		while ((lex = ik.next()) != null) {
			count--;
			String tmp = "";
			tmp = lex.getLexemeText();
			if (m_UserDic.containsKey(tmp)) {
				if (m_UserDic.get(tmp) == 109) {
					count = 2;
				}
			}
			if (count == 1) {
				str.append(tmp);
				count = 2;
			}
		}
		Expectation expectationinfo = new Expectation();

		// expectationinfo.setInfo(str.toString().trim());
		expectationinfo.setExpectationInfo(str.toString().trim());
		map.setExpectation(expectationinfo);
		// expectationinfo.setExpectationInfo(str.toString().trim());
		expectationinfo.setCandidateid((long) id);
		expectationinfo.setUpdateTime(new Date());
		dao.insertExpectation(expectationinfo);
		str = null;
		expectationinfo = null;
	}
	// */

	/*
	 * private void parseExpectationBehind(int id ,String info,IDatabaseDao dao)
	 * throws IOException { Lexeme lex = null; StringReader sr = new
	 * StringReader(info); IKSegmenter ik = new IKSegmenter(sr, true);
	 * StringBuilder str =new StringBuilder() ; int count = 0; while ((lex =
	 * ik.next()) != null) { count--; String tmp = ""; tmp =
	 * lex.getLexemeText(); if (m_UserDic.containsKey(tmp)) { if
	 * (m_UserDic.get(tmp) == 109) { count = 2; } } if(count==1) {
	 * str.append(tmp) ; count =2; } } Expectation expectationinfo = new
	 * Expectation(); expectationinfo.setExpectationInfo(str.toString().trim());
	 * expectationinfo.setCandidateid(id); expectationinfo.setUpdateTime(new
	 * Date()); dao.insertExpectation(expectationinfo); str = null;
	 * expectationinfo = null; } //
	 */

	/**
	 * 函数名：parseMedal() 功 能：识别获奖情况信息块的起止时间、奖励内容
	 * 
	 * @throws IOException
	 */
	/// *
	private void parseMedalBehind(int id, String info, IDatabaseDao dao, CVObject map) throws IOException {
		info = info.replaceAll("||    |||", "");
		// System.out.println("medal info");
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<Medal> mList = new ArrayList<Medal>();
		if (map.getMedals() != null) {
			mList = map.getMedals();
		}
		Pattern pattern = Pattern.compile(
				"((19\\d{2}|20\\d{2})-(19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})\\/0\\d{1})|((19\\d{2}|20\\d{2})\\/11)|((19\\d{2}|20\\d{2})\\/12)|((19\\d{2}|20\\d{2})-0\\d{1})|((19\\d{2}|20\\d{2})-11)|((19\\d{2}|20\\d{2})-12)|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.0\\d{1})|((19\\d{2}|20\\d{2})\\.11)|((19\\d{2}|20\\d{2})\\.12)|现在|至今|到现在|目前");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());
		}
		int length = info.length();
		String medal = "";
		int type = 0;
		int iContent = 0;
		boolean bContent = false;
		for (int i = 0, len = iList.size(); i < len; i++) {
			if (iList.size() > 0) {
				if (i == 0) {
					medal = info.substring(iList.get(0), len == 1 ? length : iList.get(1)).replaceAll(sList.get(0), "");
					Medal medalinfo = new Medal();
					String text = sList.get(i);
					medalinfo.setGetTime(getStartTimeMedal(text));
					medalinfo.setInfo(medal);
					medalinfo.setMedalInfo(info.trim());
					// System.out.println("medalinfo" + medalinfo.toString() );
					mList.add(medalinfo);
					medalinfo.setCandidateid(id);
					medalinfo.setUpdateTime(new Date());
					dao.insertMedal(medalinfo);
					medalinfo = null;
				} else if (i <= len - 2) {
					medal = info.substring(iList.get(i), iList.get(i + 1)).replaceAll(sList.get(i), "");
					Medal medalinfo = new Medal();
					String text = sList.get(i);
					medalinfo.setGetTime(getStartTimeMedal(text));
					medalinfo.setInfo(medal);
					medalinfo.setMedalInfo(info.trim());
					// System.out.println("medalinfo" + medalinfo.toString() );
					mList.add(medalinfo);
					medalinfo.setCandidateid(id);
					medalinfo.setUpdateTime(new Date());
					dao.insertMedal(medalinfo);
					medalinfo = null;
				} else {
					medal = info.substring(iList.get(i), length).replaceAll(sList.get(i), "");
					Medal medalinfo = new Medal();
					String text = sList.get(i);
					medalinfo.setGetTime(getStartTimeMedal(text));
					medalinfo.setInfo(medal);
					medalinfo.setMedalInfo(info.trim());
					// System.out.println("medalinfo" + medalinfo.toString() );
					mList.add(medalinfo);
					medalinfo.setCandidateid(id);
					medalinfo.setUpdateTime(new Date());
					dao.insertMedal(medalinfo);
					medalinfo = null;
				}
			} else {
				medal = info;
				Medal medalinfo = new Medal();
				medalinfo.setInfo(medal.trim());
				medalinfo.setMedalInfo(info.trim());
				// System.out.println("medalinfo" + medalinfo.toString() );
				mList.add(medalinfo);
				medalinfo.setCandidateid(id);
				medalinfo.setUpdateTime(new Date());
				dao.insertMedal(medalinfo);
				medalinfo = null;
			}
		}
		if (sList.size() == 0) {
			Medal medalinfo = new Medal();
			medalinfo.setInfo(medal);
			medalinfo.setMedalInfo(info.trim());
			// System.out.println("medalinfo" + medalinfo.toString() );
			mList.add(medalinfo);
			medalinfo.setCandidateid(id);
			medalinfo.setUpdateTime(new Date());
			dao.insertMedal(medalinfo);
			medalinfo = null;
		}
		map.setMedals(mList);
		iList = null;
		sList = null;
		mList = null;
	}
	// */

	/*
	 * private void parseMedalBehind(int id ,String info,IDatabaseDao dao)
	 * throws IOException { List<Integer> iList = new ArrayList<Integer>();
	 * List<String> sList = new ArrayList<String>(); Pattern pattern = Pattern
	 * .compile(
	 * "((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前"
	 * ); Matcher matcher = pattern.matcher(info); while (matcher.find()) {
	 * String str = matcher.group(); sList.add(str); iList.add(matcher.start());
	 * } Pattern pyear = Pattern.compile("\\d{4}"); Pattern pMonth =
	 * Pattern.compile("\\d{2}"); Pattern pDay= Pattern.compile("\\d{2}"); int
	 * length = info.length(); String medal = ""; int type = 0; int iContent =
	 * 0; boolean bContent = false; for (int i = 0, len = iList.size(); i < len;
	 * i++) { if (iList.size() > 0) { if (i == 0) { medal =
	 * info.substring(iList.get(0), len == 1 ? length :
	 * iList.get(1)).replaceAll( sList.get(0), ""); Medal medalinfo =new
	 * Medal(); String text = sList.get(i);
	 * medalinfo.setGetTime(getStartTime(text)); medalinfo.setInfo(medal);
	 * medalinfo.setMedalInfo(info.trim()); medalinfo.setCandidateid(id);
	 * medalinfo.setUpdateTime(new Date()); dao.insertMedal(medalinfo);
	 * medalinfo = null; } else if (i <= len - 2) { medal =
	 * info.substring(iList.get(i), iList.get(i + 1)) .replaceAll(sList.get(i),
	 * ""); Medal medalinfo =new Medal(); String text = sList.get(i);
	 * medalinfo.setGetTime(getStartTime(text)); medalinfo.setInfo(medal);
	 * medalinfo.setMedalInfo(info.trim()); medalinfo.setCandidateid(id);
	 * medalinfo.setUpdateTime(new Date()); dao.insertMedal(medalinfo);
	 * medalinfo = null; } else { medal = info.substring(iList.get(i),
	 * length).replaceAll( sList.get(i), ""); Medal medalinfo =new Medal();
	 * String text = sList.get(i); medalinfo.setGetTime(getStartTime(text));
	 * medalinfo.setInfo(medal); medalinfo.setMedalInfo(info.trim());
	 * medalinfo.setCandidateid(id); medalinfo.setUpdateTime(new Date());
	 * dao.insertMedal(medalinfo); medalinfo = null; } } else { medal = info;
	 * Medal medalinfo =new Medal(); medalinfo.setInfo(medal);
	 * medalinfo.setMedalInfo(info.trim()); medalinfo.setCandidateid(id);
	 * medalinfo.setUpdateTime(new Date()); dao.insertMedal(medalinfo);
	 * medalinfo = null; } } if (sList.size() == 0) { Medal medalinfo =new
	 * Medal(); medalinfo.setInfo(medal); medalinfo.setMedalInfo(info.trim());
	 * medalinfo.setCandidateid(id); medalinfo.setUpdateTime(new Date());
	 * dao.insertMedal(medalinfo); medalinfo = null; } iList = null; sList =
	 * null; } //
	 */

	/**
	 * 函数名：parsePatent() * 功 能：识别专利与著作权。
	 */
	/// *
	private void parsePatentBehind(int id, String info, IDatabaseDao dao, CVObject map) {
		info = info.replaceAll("||    |||", "");
		Patent patentinfo = new Patent();
		patentinfo.setInfo(info.trim());
		patentinfo.setPatentInfo(info.trim());
		// System.out.println("patentinfo" + patentinfo.toString() );
		List<Patent> patents = new ArrayList<Patent>();
		if (map.getPatents() != null) {
			patents = map.getPatents();
		}

		String localInfo = info;
		// System.out.println("localInfo = " + localInfo);
		String[] stringList = localInfo.split("\r");
		for (String stringListOne : stringList) {
			Patent patentinfoTemp = new Patent();
			String[] stringListTemp = stringListOne.split("\\.|。");
			if (stringListTemp.length > 1) {
				// Patent patentinfoTemp = new Patent();
				for (int ii = 0; ii < stringListTemp.length; ii++) {
					switch (ii) {
					case 0:
						patentinfoTemp.setInventor(stringListTemp[ii]);
						break;
					case 1:
						// patentinfoTemp.setPatentName(stringListTemp[ii]);
						patentinfoTemp.setInfo(stringListTemp[ii]);
						break;
					default:
						Pattern pattern = Pattern
								.compile("([A-Za-z]{0,2})\\d{12}\\.\\d{1}|([A-Za-z]{0,2})\\d{12}\\.([0-9A-Za-z]+)");
						Matcher matcher = pattern.matcher(stringListTemp[ii]);
						while (matcher.find()) {
							patentinfoTemp.setPatentId(matcher.group());
							break;
						}
						pattern = Pattern.compile("19\\d{2}|20\\d{2}");
						matcher = pattern.matcher(stringListTemp[ii]);
						while (matcher.find()) {
							patentinfoTemp.setTime(matcher.group());
							break;
						}
						break;
					}
				}
				// patents.add(patentinfoTemp);
			}
			Pattern pattern = Pattern
					.compile("([A-Za-z]{0,2})\\d{12}\\.\\d{1}|([A-Za-z]{0,2})\\d{12}\\.([0-9A-Za-z]+)");
			Matcher matcher = pattern.matcher(stringListOne);
			while (matcher.find()) {
				patentinfoTemp.setPatentId(matcher.group());
				break;
			}
			if (patentinfoTemp.getPatentId() == null) {
			} else {
				patents.add(patentinfoTemp);
				patentinfoTemp.setCandidateid(id);
				patentinfoTemp.setUpdateTime(new Date());
				dao.insertPatent(patentinfoTemp);
			}
		}
		map.setPatents(patents);
		patentinfo = null;
	}
	// */

	/*
	 * private void parsePatentBehind(int id ,String info,IDatabaseDao dao) {
	 * Patent patentinfo = new Patent(); patentinfo.setPatentInfo(info.trim());
	 * patentinfo.setCandidateid(id); patentinfo.setUpdateTime(new Date());
	 * dao.insertPatent(patentinfo); patentinfo = null; } //
	 */

	/**
	 * 函数名：parsePaper() * 功 能：识别论文与著作
	 */
	/// *
	private void parsePaperBehind(int id, String info, IDatabaseDao dao, CVObject map) {
		info = info.replaceAll("||    |||", "");
		Paper paperinfo = new Paper();
		paperinfo.setInfo(info.trim());
		paperinfo.setPaperInfo(info.trim());
		List<Paper> papers = new ArrayList<Paper>();
		if (map.getPapers() != null) {
			papers = map.getPapers();
		}
		String localInfo = info;
		// System.out.println("localInfo = " + localInfo);
		String[] stringList = localInfo.split("\r");
		for (String stringListOne : stringList) {
			String[] stringListTemp = stringListOne.split("\\.");
			if (stringListTemp.length > 1) {
				Paper paperinfoTemp = new Paper();
				for (int ii = 0; ii < stringListTemp.length; ii++) {
					switch (ii) {
					case 0:
						paperinfoTemp.setAuthor(stringListTemp[ii]);
						break;
					case 1:
						paperinfoTemp.setTitle(stringListTemp[ii]);
						break;
					case 2:
						String[] paperinfoTempList = stringListTemp[ii].split(",");
						paperinfoTemp.setMagazine(paperinfoTempList[0]);

						// String[] paperinfoTempListFinal =
						// stringListTemp[ii].split(",");
						Pattern pattern = Pattern.compile("19\\d{2}|20\\d{2}");
						for (String paperinfoTempListFinalOne : paperinfoTempList) {
							paperinfoTempListFinalOne.replaceAll("-", "");
							paperinfoTempListFinalOne.replaceAll("\\.", "");
							Matcher matcher = pattern.matcher(paperinfoTempListFinalOne);
							while (matcher.find()) {
								paperinfoTemp.setTime(paperinfoTempListFinalOne);
								break;
							}
						}
						break;
					default:
						String[] paperinfoTempListFinal = stringListTemp[ii].split(",");
						pattern = Pattern.compile("19\\d{2}|20\\d{2}");
						for (String paperinfoTempListFinalOne : paperinfoTempListFinal) {
							paperinfoTempListFinalOne.replaceAll("-", "");
							paperinfoTempListFinalOne.replaceAll("\\.", "");
							Matcher matcher = pattern.matcher(paperinfoTempListFinalOne);
							while (matcher.find()) {
								paperinfoTemp.setTime(paperinfoTempListFinalOne);
								break;
							}
						}
						break;

					}
				}
				if (paperinfoTemp.getTitle() == null && paperinfoTemp.getMagazine() == null) {
				} else {
					papers.add(paperinfoTemp);
					paperinfoTemp.setCandidateid(id);
					paperinfoTemp.setUpdateTime(new Date());
					dao.insertPaper(paperinfoTemp);
				}
			}
		}

		map.setPapers(papers);
		paperinfo = null;
	}
	// */

	/*
	 * private void parsePaperBehind(int id ,String info,IDatabaseDao dao) {
	 * Paper paperinfo = new Paper(); paperinfo.setPaperInfo(info.trim());
	 * paperinfo.setCandidateid(id); paperinfo.setUpdateTime(new Date());
	 * dao.insertPaper(paperinfo); paperinfo = null; } //
	 */

	/**
	 * 函数名：parseProject() 功 能：识别项目经历信息块的起止时间、公司、部门、职位、 项目职责、业绩、项目内容等
	 * 
	 * @throws IOException
	 */
	/// *
	private void parseProjectBehind(int id, String info, IDatabaseDao dao, CVObject map) throws IOException {
		info = info.replaceAll("||    |||", "");
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<Project> pList = new ArrayList<Project>();
		if (map.getProjects() != null) {
			pList = map.getProjects();
		}
		// 处理包含年和月的情况
		Pattern pattern = Pattern.compile(
				"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 ");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}
		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i + 1) - iList.get(i) >= 15) {
				iList.set(i, info.length() * 2);
				i++;
			} else {
				i = i + 2;
			}
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i) == info.length() * 2) {
				iList.remove(i);
				sList.remove(i);
			} else {
				i++;
			}
		}

		if (iList.size() % 2 == 1) {
			iList.remove(iList.size() - 1);
			sList.remove(sList.size() - 1);
		}

		// 处理只有年份的情况
		if (iList.size() < 2) {
			Pattern pattern1 = Pattern.compile(
					"((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))|现在|至今|到现在|目前 ");
			Matcher matcher1 = pattern1.matcher(info);
			while (matcher1.find()) {
				String str = matcher1.group();
				sList.add(str);
				iList.add(matcher1.start());
			}

			for (Integer iListOne : iList) {
				// System.out.println(iListOne);
			}
			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i + 1) - iList.get(i) >= 15) {
					iList.set(i, info.length() * 2);
					i++;
				} else {
					i = i + 2;
				}
			}

			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i) == info.length() * 2) {
					iList.remove(i);
					sList.remove(i);
				} else {
					i++;
				}
			}

			if (iList.size() % 2 == 1) {
				iList.remove(iList.size() - 1);
				sList.remove(sList.size() - 1);
			}
		}

		int length = info.length();
		String project = "";
		Lexeme lex = null;
		String temp = "";
		int type = 0;
		int iCompany, iProject_name, iContent, iDuty, iAchieve, iCity;
		iCompany = iProject_name = iContent = iDuty = iAchieve = iCity = 0;
		boolean bCompany, bProject_name, bContent, bDuty, bAchieve, bCity;
		bCompany = bProject_name = bContent = bDuty = bAchieve = bCity = false;
		for (int i = 0, len = iList.size(); i < len;) {
			// System.out.println("project = " + project);
			if (iList.size() > 2) {
				if (i == 0) {
					String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
					project = info.substring(iList.get(0), iList.get(2));
					// System.out.println("project before = " + project);

					// System.out.println("project after = " + project);

					List<Integer> tempiList = new ArrayList<Integer>();
					List<String> tempsList = new ArrayList<String>();
					List<Medal> tempmList = new ArrayList<Medal>();
					pattern = Pattern.compile(
							"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
					matcher = pattern.matcher(project);
					int projectNameFlag = 0;
					while (matcher.find()) {
						String str = matcher.group();
						tempsList.add(str);
						tempiList.add(matcher.start());
						if (str.equals("项目名称") || str.equals("名称")) {
							projectNameFlag = 1;
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							// System.out.println(project.substring(tempiList.get(tempi),
							// project.length()));
						} else {
							// System.out.println(project.substring(tempiList.get(tempi),
							// tempiList.get(tempi+1)));
						}
					}
					Project projectinfo = new Project();
					String text = sList.get(i);
					projectinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					projectinfo.setEndTime(getStartTime(textSen));
					if (projectNameFlag == 0) {
						if (tempiList.size() == 0) {
							projectinfo.setInfo(project.substring(0, project.length()));
						} else {
							projectinfo.setInfo(project.substring(0, tempiList.get(0)));
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
							}
						} else {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo
										.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo
										.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							}
						}
					}

					pList.add(projectinfo);
					projectinfo.setCandidateid(id);
					projectinfo.setUpdateTime(new Date());
					dao.insertProject(projectinfo);
					projectinfo = null;
				} else if (i < len - 3) {
					String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
					project = info.substring(iList.get(i), iList.get(i + 2));
					// System.out.println("project before = " + project);

					// System.out.println("project after = " + project);

					List<Integer> tempiList = new ArrayList<Integer>();
					List<String> tempsList = new ArrayList<String>();
					List<Medal> tempmList = new ArrayList<Medal>();
					pattern = Pattern.compile(
							"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
					matcher = pattern.matcher(project);
					int projectNameFlag = 0;
					while (matcher.find()) {
						String str = matcher.group();
						tempsList.add(str);
						tempiList.add(matcher.start());
						if (str.equals("项目名称") || str.equals("名称")) {
							projectNameFlag = 1;
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							// System.out.println(project.substring(tempiList.get(tempi),
							// project.length()));
						} else {
							// System.out.println(project.substring(tempiList.get(tempi),
							// tempiList.get(tempi+1)));
						}
					}
					Project projectinfo = new Project();
					String text = sList.get(i);
					projectinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					projectinfo.setEndTime(getStartTime(textSen));
					if (projectNameFlag == 0) {
						if (tempiList.size() == 0) {
							projectinfo.setInfo(project.substring(0, project.length()));
						} else {
							projectinfo.setInfo(project.substring(0, tempiList.get(0)));
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
							}
						} else {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo
										.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo
										.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							}
						}
					}

					pList.add(projectinfo);
					projectinfo.setCandidateid(id);
					projectinfo.setUpdateTime(new Date());
					dao.insertProject(projectinfo);
					projectinfo = null;
				} else {
					String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
					project = info.substring(iList.get(i), length);
					// System.out.println("project before = " + project);

					// System.out.println("project after = " + project);

					List<Integer> tempiList = new ArrayList<Integer>();
					List<String> tempsList = new ArrayList<String>();
					List<Medal> tempmList = new ArrayList<Medal>();
					pattern = Pattern.compile(
							"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
					matcher = pattern.matcher(project);
					int projectNameFlag = 0;
					while (matcher.find()) {
						String str = matcher.group();
						tempsList.add(str);
						tempiList.add(matcher.start());
						if (str.equals("项目名称") || str.equals("名称")) {
							projectNameFlag = 1;
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							// System.out.println(project.substring(tempiList.get(tempi),
							// project.length()));
						} else {
							// System.out.println(project.substring(tempiList.get(tempi),
							// tempiList.get(tempi+1)));
						}
					}
					Project projectinfo = new Project();
					String text = sList.get(i);
					projectinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					projectinfo.setEndTime(getStartTime(textSen));
					if (projectNameFlag == 0) {
						if (tempiList.size() == 0) {
							projectinfo.setInfo(project.substring(0, project.length()));
						} else {
							projectinfo.setInfo(project.substring(0, tempiList.get(0)));
						}
					}
					for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
						if (tempi >= templen - 1) {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
							}
						} else {
							if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
								projectinfo
										.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
									|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
								projectinfo
										.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
									|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
									|| tempsList.get(tempi).equals("项目职责")) {
								projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
							}
						}
					}

					pList.add(projectinfo);
					projectinfo.setCandidateid(id);
					projectinfo.setUpdateTime(new Date());
					dao.insertProject(projectinfo);
					projectinfo = null;
				}
			} else {
				String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
				project = info.substring(0, length);
				// System.out.println("project before = " + project);

				// System.out.println("project after = " + project);

				List<Integer> tempiList = new ArrayList<Integer>();
				List<String> tempsList = new ArrayList<String>();
				List<Medal> tempmList = new ArrayList<Medal>();
				pattern = Pattern.compile(
						"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
				matcher = pattern.matcher(project);
				int projectNameFlag = 0;
				while (matcher.find()) {
					String str = matcher.group();
					tempsList.add(str);
					tempiList.add(matcher.start());
					if (str.equals("项目名称") || str.equals("名称")) {
						projectNameFlag = 1;
					}
				}
				for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
					if (tempi >= templen - 1) {
						// System.out.println(project.substring(tempiList.get(tempi),
						// project.length()));
					} else {
						// System.out.println(project.substring(tempiList.get(tempi),
						// tempiList.get(tempi+1)));
					}
				}
				Project projectinfo = new Project();
				String text = sList.get(i);
				projectinfo.setStartTime(getStartTime(text));
				String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
				projectinfo.setEndTime(getStartTime(textSen));
				if (projectNameFlag == 0) {
					if (tempiList.size() == 0) {
						projectinfo.setInfo(project.substring(0, project.length()));
					} else {
						projectinfo.setInfo(project.substring(0, tempiList.get(0)));
					}
				}
				for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
					if (tempi >= templen - 1) {
						if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
							projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
						} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
								|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
							projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
						} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
								|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
								|| tempsList.get(tempi).equals("项目职责")) {
							projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
						}
					} else {
						if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
							projectinfo.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
						} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
								|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
							projectinfo.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
						} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
								|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
								|| tempsList.get(tempi).equals("项目职责")) {
							projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
						}
					}
				}

				pList.add(projectinfo);
				projectinfo.setCandidateid(id);
				projectinfo.setUpdateTime(new Date());
				dao.insertProject(projectinfo);
				projectinfo = null;
			}
			i += 2;
		}

		if (iList.size() <= 0) {
			String project_name = "", company = "", content = "", duty = "", achieve = "", city = "";
			project = info.substring(0, length);
			// System.out.println("project before = " + project);

			// System.out.println("project after = " + project);

			List<Integer> tempiList = new ArrayList<Integer>();
			List<String> tempsList = new ArrayList<String>();
			List<Medal> tempmList = new ArrayList<Medal>();
			pattern = Pattern.compile(
					"主要工作|责任描述|主要负责|主要从事|负责|项目职责|工作业绩|主要成绩|主要业绩|项目成果|项目成绩|项目业绩|项目效果|简介|工作内容|工作介绍|工作描述|工作简介|项目内容|项目简介|项目类型|项目介绍|项目描述|软件环境|开发工具|开发环境|项目名称|项目成果");
			matcher = pattern.matcher(project);
			int projectNameFlag = 0;
			while (matcher.find()) {
				String str = matcher.group();
				tempsList.add(str);
				tempiList.add(matcher.start());
				if (str.equals("项目名称") || str.equals("名称")) {
					projectNameFlag = 1;
				}
			}
			for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
				if (tempi >= templen - 1) {
					// System.out.println(project.substring(tempiList.get(tempi),
					// project.length()));
				} else {
					// System.out.println(project.substring(tempiList.get(tempi),
					// tempiList.get(tempi+1)));
				}
			}
			Project projectinfo = new Project();
			if (projectNameFlag == 0) {
				if (tempiList.size() == 0) {
					projectinfo.setInfo(project.substring(0, project.length()));
				} else {
					projectinfo.setInfo(project.substring(0, tempiList.get(0)));
				}
			}
			for (int tempi = 0, templen = tempiList.size(); tempi < templen; tempi++) {
				if (tempi >= templen - 1) {
					if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
						projectinfo.setContent(project.substring(tempiList.get(tempi), project.length()));
					} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
							|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
						projectinfo.setAchieve(project.substring(tempiList.get(tempi), project.length()));
					} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
							|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
							|| tempsList.get(tempi).equals("项目职责")) {
						projectinfo.setDuty(project.substring(tempiList.get(tempi), project.length()));
					}
				} else {
					if (tempsList.get(tempi).equals("项目内容") || tempsList.get(tempi).equals("工作内容")) {
						projectinfo.setContent(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
					} else if (tempsList.get(tempi).equals("项目成果") || tempsList.get(tempi).equals("项目成绩")
							|| tempsList.get(tempi).equals("项目业绩") || tempsList.get(tempi).equals("项目效果")) {
						projectinfo.setAchieve(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
					} else if (tempsList.get(tempi).equals("主要工作") || tempsList.get(tempi).equals("主要负责")
							|| tempsList.get(tempi).equals("主要从事") || tempsList.get(tempi).equals("负责")
							|| tempsList.get(tempi).equals("项目职责")) {
						projectinfo.setDuty(project.substring(tempiList.get(tempi), tempiList.get(tempi + 1)));
					}
				}
			}
			projectinfo.setStartTime("0000-01-01");
			projectinfo.setEndTime("0000-01-01");
			pList.add(projectinfo);
			projectinfo.setCandidateid(id);
			projectinfo.setUpdateTime(new Date());
			dao.insertProject(projectinfo);
			projectinfo = null;
		}

		map.setProjects(pList);
		iList = null;
		sList = null;
		pList = null;
	}
	// */

	/*
	 * private void parseProjectBehind(int id ,String info,IDatabaseDao dao)
	 * throws IOException { List<Integer> iList = new ArrayList<Integer>();
	 * List<String> sList = new ArrayList<String>(); Pattern pattern =
	 * Pattern.compile(
	 * "((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前"
	 * ); Matcher matcher = pattern.matcher(info); while (matcher.find()) {
	 * String str = matcher.group(); sList.add(str); iList.add(matcher.start());
	 * } Pattern pyear = Pattern.compile("\\d{4}"); Pattern pMonth =
	 * Pattern.compile("\\d{2}"); Pattern pDay= Pattern.compile("\\d{2}"); int
	 * length = info.length(); String project = ""; Lexeme lex = null; String
	 * temp = ""; int type = 0; int iCompany, iProject_name, iContent, iDuty,
	 * iAchieve, iCity; iCompany = iProject_name = iContent = iDuty = iAchieve =
	 * iCity = 0; boolean bCompany, bProject_name, bContent, bDuty, bAchieve,
	 * bCity; bCompany = bProject_name = bContent = bDuty = bAchieve = bCity =
	 * false; for (int i = 0, len = iList.size(); i < len;) { if (iList.size() >
	 * 2) { if (i == 0) { String project_name = "", company = "", content = "",
	 * duty = "", achieve = "", city = ""; project =
	 * info.substring(iList.get(0), iList.get(2)); StringReader sr = new
	 * StringReader(project); IKSegmenter ik = new IKSegmenter(sr, true); while
	 * ((lex = ik.next()) != null) { iCompany--; iProject_name--; iContent--;
	 * iDuty--; iAchieve--; iCity--; temp = lex.getLexemeText(); if
	 * (m_UserDic.containsKey(temp)) { type = m_UserDic.get(temp); switch (type)
	 * { case 208: bCompany = true; iCompany = 2; bDuty = bProject_name =
	 * bAchieve = bContent = bCity = false; break; case 307: bProject_name =
	 * true; iProject_name = 2; bCompany =bDuty = bAchieve = bContent = bCity =
	 * false; break; case 306: bContent = true; iContent = 2; bProject_name
	 * =bCompany =bDuty = bAchieve = bCity = false; break; case 301: bDuty =
	 * true; iDuty = 2; bProject_name =bCompany =bAchieve = bContent = bCity =
	 * false; break; case 302: bAchieve = true; iAchieve = 2; bProject_name
	 * =bCompany =bDuty = bContent = bCity = false; break; case 203: bCity =
	 * true; iCity = 2; bProject_name =bCompany =bDuty = bAchieve = bContent =
	 * false; break; default: break; } } if (bCompany && (iCompany == 1)) {
	 * company+=temp; iCompany = 2; } if ( bProject_name && (iProject_name ==
	 * 1)) { project_name+=temp; iProject_name = 2; } if (bContent && (iContent
	 * == 1)) { content+=temp; iContent = 2; } if ( bDuty && (iDuty == 1)) {
	 * duty+=temp; iDuty = 2; } if (bAchieve && (iAchieve == 1)) {
	 * achieve+=temp; iAchieve = 2; } if (bCity && (iCity == 1)) { city+=temp;
	 * iCity = 2; } } Project projectinfo = new Project(); String text =
	 * sList.get(i); projectinfo.setStartTime(getStartTime(text)); String
	 * textSen = (i + 1)>=sList.size()?"":sList.get(i + 1);
	 * projectinfo.setEndTime(getStartTime(textSen));
	 * projectinfo.setCompany(company);
	 * projectinfo.setProjectName(project_name); projectinfo.setDuty(duty);
	 * projectinfo.setAchieve(achieve); projectinfo.setContent(content);
	 * projectinfo.setCity(city); projectinfo.setProjectInfo(info.trim());
	 * projectinfo.setCandidateid(id); projectinfo.setUpdateTime(new Date());
	 * dao.insertProject(projectinfo); projectinfo = null; } else if (i < len -
	 * 3) { String project_name = "", company = "", content = "", duty = "",
	 * achieve = "", city = ""; project = info.substring(iList.get(i),
	 * iList.get(i+2)); StringReader sr = new StringReader(project); IKSegmenter
	 * ik = new IKSegmenter(sr, true); while ((lex = ik.next()) != null) {
	 * iCompany--; iProject_name--; iContent--; iDuty--; iAchieve--; iCity--;
	 * temp = lex.getLexemeText(); if (m_UserDic.containsKey(temp)) { type =
	 * m_UserDic.get(temp); switch (type) { case 208: bCompany = true; iCompany
	 * = 2; bDuty = bProject_name = bAchieve = bContent = bCity = false; break;
	 * case 307: bProject_name = true; iProject_name = 2; bCompany =bDuty =
	 * bAchieve = bContent = bCity = false; break; case 306: bContent = true;
	 * iContent = 2; bProject_name =bCompany =bDuty = bAchieve = bCity = false;
	 * break; case 301: bDuty = true; iDuty = 2; bProject_name =bCompany
	 * =bAchieve = bContent = bCity = false; break; case 302: bAchieve = true;
	 * iAchieve = 2; bProject_name =bCompany =bDuty = bContent = bCity = false;
	 * break; case 203: bCity = true; iCity = 2; bProject_name =bCompany =bDuty
	 * = bAchieve = bContent = false; break; default: break; } } if (bCompany &&
	 * (iCompany == 1)) { company+=temp; iCompany = 2; } if ( bProject_name &&
	 * (iProject_name == 1)) { project_name+=temp; iProject_name = 2; } if
	 * (bContent && (iContent == 1)) { content+=temp; iContent = 2; } if ( bDuty
	 * && (iDuty == 1)) { duty+=temp; iDuty = 2; } if (bAchieve && (iAchieve ==
	 * 1)) { achieve+=temp; iAchieve = 2; } if (bCity && (iCity == 1)) {
	 * city+=temp; iCity = 2; } } Project projectinfo = new Project(); String
	 * text = sList.get(i); projectinfo.setStartTime(getStartTime(text)); String
	 * textSen = (i + 1)>=sList.size()?"":sList.get(i + 1);
	 * projectinfo.setEndTime(getStartTime(textSen));
	 * projectinfo.setCompany(company);
	 * projectinfo.setProjectName(project_name); projectinfo.setDuty(duty);
	 * projectinfo.setAchieve(achieve); projectinfo.setContent(content);
	 * projectinfo.setCity(city); projectinfo.setProjectInfo(info.trim());
	 * projectinfo.setCandidateid(id); projectinfo.setUpdateTime(new Date());
	 * dao.insertProject(projectinfo); projectinfo = null; } else { String
	 * project_name = "", company = "", content = "", duty = "", achieve = "",
	 * city = ""; project = info.substring(iList.get(i), length); StringReader
	 * sr = new StringReader(project); IKSegmenter ik = new IKSegmenter(sr,
	 * true); while ((lex = ik.next()) != null) { iCompany--; iProject_name--;
	 * iContent--; iDuty--; iAchieve--; iCity--; temp = lex.getLexemeText(); if
	 * (m_UserDic.containsKey(temp)) { type = m_UserDic.get(temp); switch (type)
	 * { case 208: bCompany = true; iCompany = 2; bDuty = bProject_name =
	 * bAchieve = bContent = bCity = false; break; case 307: bProject_name =
	 * true; iProject_name = 2; bCompany =bDuty = bAchieve = bContent = bCity =
	 * false; break; case 306: bContent = true; iContent = 2; bProject_name
	 * =bCompany =bDuty = bAchieve = bCity = false; break; case 301: bDuty =
	 * true; iDuty = 2; bProject_name =bCompany =bAchieve = bContent = bCity =
	 * false; break; case 302: bAchieve = true; iAchieve = 2; bProject_name
	 * =bCompany =bDuty = bContent = bCity = false; break; case 203: bCity =
	 * true; iCity = 2; bProject_name =bCompany =bDuty = bAchieve = bContent =
	 * false; break; default: break; } } if (bCompany && (iCompany == 1)) {
	 * company+=temp; iCompany = 2; } if ( bProject_name && (iProject_name ==
	 * 1)) { project_name+=temp; iProject_name = 2; } if (bContent && (iContent
	 * == 1)) { content+=temp; iContent = 2; } if ( bDuty && (iDuty == 1)) {
	 * duty+=temp; iDuty = 2; } if (bAchieve && (iAchieve == 1)) {
	 * achieve+=temp; iAchieve = 2; } if (bCity && (iCity == 1)) { city+=temp;
	 * iCity = 2; } } Project projectinfo = new Project(); String text =
	 * sList.get(i); projectinfo.setStartTime(getStartTime(text)); String
	 * textSen = (i + 1)>=sList.size()?"":sList.get(i + 1);
	 * projectinfo.setEndTime(getStartTime(textSen));
	 * projectinfo.setCompany(company);
	 * projectinfo.setProjectName(project_name); projectinfo.setDuty(duty);
	 * projectinfo.setAchieve(achieve); projectinfo.setContent(content);
	 * projectinfo.setCity(city); projectinfo.setProjectInfo(info.trim());
	 * projectinfo.setCandidateid(id); projectinfo.setUpdateTime(new Date());
	 * dao.insertProject(projectinfo); projectinfo = null; } } else { String
	 * project_name = "", company = "", content = "", duty = "", achieve = "",
	 * city = ""; project = info.substring(0, length); StringReader sr = new
	 * StringReader(project); IKSegmenter ik = new IKSegmenter(sr, true); while
	 * ((lex = ik.next()) != null) { iCompany--; iProject_name--; iContent--;
	 * iDuty--; iAchieve--; iCity--; temp = lex.getLexemeText(); if
	 * (m_UserDic.containsKey(temp)) { type = m_UserDic.get(temp); switch (type)
	 * { case 208: bCompany = true; iCompany = 2; bDuty = bProject_name =
	 * bAchieve = bContent = bCity = false; break; case 307: bProject_name =
	 * true; iProject_name = 2; bCompany =bDuty = bAchieve = bContent = bCity =
	 * false; break; case 306: bContent = true; iContent = 2; bProject_name
	 * =bCompany =bDuty = bAchieve = bCity = false; break; case 301: bDuty =
	 * true; iDuty = 2; bProject_name =bCompany =bAchieve = bContent = bCity =
	 * false; break; case 302: bAchieve = true; iAchieve = 2; bProject_name
	 * =bCompany =bDuty = bContent = bCity = false; break; case 203: bCity =
	 * true; iCity = 2; bProject_name =bCompany =bDuty = bAchieve = bContent =
	 * false; break; default: break; } } if (bCompany && (iCompany == 1)) {
	 * company+=temp; iCompany = 2; } if ( bProject_name && (iProject_name ==
	 * 1)) { project_name+=temp; iProject_name = 2; } if (bContent && (iContent
	 * == 1)) { content+=temp; iContent = 2; } if ( bDuty && (iDuty == 1)) {
	 * duty+=temp; iDuty = 2; } if (bAchieve && (iAchieve == 1)) {
	 * achieve+=temp; iAchieve = 2; } if (bCity && (iCity == 1)) { city+=temp;
	 * iCity = 2; } } Project projectinfo = new Project(); String text =
	 * sList.get(i); projectinfo.setStartTime(getStartTime(text)); String
	 * textSen = (i + 1)>=sList.size()?"":sList.get(i + 1);
	 * projectinfo.setEndTime(getStartTime(textSen));
	 * projectinfo.setCompany(company);
	 * projectinfo.setProjectName(project_name); projectinfo.setDuty(duty);
	 * projectinfo.setAchieve(achieve); projectinfo.setContent(content);
	 * projectinfo.setCity(city); projectinfo.setProjectInfo(info.trim());
	 * projectinfo.setCandidateid(id); projectinfo.setUpdateTime(new Date());
	 * dao.insertProject(projectinfo); projectinfo = null; } i += 2; } iList =
	 * null; sList = null; } //
	 */

	/**
	 * 函数名：parseJob() * 功 能：识别工作经历信息块的起止时间、公司、部门、职位、 汇报对象、工作地点、工作职责、业绩、离职原因等。
	 * 
	 * @throws IOException
	 * 
	 */
	/// *
	private void parseJobBehind(int id, String info, IDatabaseDao dao, CVObject map) throws IOException {
		info = info.replaceAll("||    |||", "");// 去掉不规则字符
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<Job> jList = new ArrayList<Job>();
		if (map.getJobs() != null) {
			jList = map.getJobs();
		}
		Pattern pattern = Pattern.compile(
				"((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前 |今|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			String str = matcher.group();
			sList.add(str);
			iList.add(matcher.start());// 时间位置
		}
		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}
		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i + 1) - iList.get(i) >= 15) {
				iList.set(i, info.length() * 2);
				i++;
			} else {
				i = i + 2;
			}
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i) == info.length() * 2) {
				iList.remove(i);
				sList.remove(i);
			} else {
				i++;
			}
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}

		if (iList.size() % 2 == 1) {
			iList.remove(iList.size() - 1);
			sList.remove(sList.size() - 1);
		}

		for (Integer iListOne : iList) {
			// System.out.println(iListOne);
		}

		// 处理只有年份的情况
		if (iList.size() < 2) {
			Pattern pattern1 = Pattern.compile(
					"((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))|现在|至今|到现在|目前 |今 ");
			Matcher matcher1 = pattern1.matcher(info);
			while (matcher1.find()) {
				String str = matcher1.group();
				sList.add(str);
				iList.add(matcher1.start());
			}

			for (Integer iListOne : iList) {
				// System.out.println(iListOne);
			}
			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i + 1) - iList.get(i) >= 15) {
					iList.set(i, info.length() * 2);
					i++;
				} else {
					i = i + 2;
				}
			}

			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i) == info.length() * 2) {
					iList.remove(i);
					sList.remove(i);
				} else {
					i++;
				}
			}

			if (iList.size() % 2 == 1) {
				iList.remove(iList.size() - 1);
				sList.remove(sList.size() - 1);
			}
		}

		int length = info.length();
		String job = "";
		Lexeme lex = null;
		String temp = "";
		int type = 0;
		int iCompany, iTitle, iReport, iMember, iDuty, iOther, iAchieve, iReason, iCity, iDepartment;
		boolean bCompany, bTitle, bReport, bMember, bDuty, bOther, bAchieve, bReason, bCity, bDepartment;
		for (int i = 0, len = iList.size(); i < len;) {
			if (iList.size() > 2) {
				if (i == 0) {
					iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther = iAchieve = iReason = iCity = 0;
					bDepartment = bCompany = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
					StringBuffer sCompany = new StringBuffer();
					StringBuffer sTitle = new StringBuffer();
					StringBuffer sReport = new StringBuffer();
					StringBuffer sMember = new StringBuffer();
					StringBuffer sDuty = new StringBuffer();
					StringBuffer sOther = new StringBuffer();
					StringBuffer sAchieve = new StringBuffer();
					StringBuffer sReason = new StringBuffer();
					StringBuffer sCity = new StringBuffer();
					StringBuffer sDepartment = new StringBuffer();
					job = info.substring(iList.get(i), iList.get(i + 2));
					StringReader sr = new StringReader(job);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iDepartment--;
						iCompany--;
						iTitle--;
						iReport--;
						iMember--;
						iDuty--;
						iOther--;
						iAchieve--;
						iReason--;
						iCity--;
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							// case 208:
							// bCompany = true;
							// iCompany = 2;
							// bDepartment =bTitle = bReport = bMember = bDuty =
							// bOther = bAchieve = bReason = bCity = false;
							// break;
							case 15:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 3:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							// case 209:
							// bTitle = true;
							// iTitle = 2;
							// bDepartment =bCompany = bReport = bMember = bDuty
							// = bOther = bAchieve = bReason = bCity = false;
							// break;
							case 14:
								bTitle = true;
								iTitle = 3;
								bDepartment = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 300:
								bMember = true;
								iMember = 2;
								bDepartment = bTitle = bCompany = bReport = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 301:
								bDuty = true;
								iDuty = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bOther = bAchieve = bReason = bCity = false;
								break;
							case 302:
								bAchieve = true;
								iAchieve = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bReason = bCity = false;
								break;
							case 303:
								bReason = true;
								iReason = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bCity = false;
								break;
							case 304:
								bCity = true;
								iCity = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = false;
								break;
							case 306:
								bReport = true;
								iReport = 2;
								bDepartment = bTitle = bCompany = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 307:
								bOther = true;
								iOther = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							case 308:
								bDepartment = true;
								iDepartment = 2;
								bOther = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							default:
								break;
							}
						}
						if (bDepartment && (iDepartment == 1)) {
							if (sDepartment.length() <= 10) {
								sDepartment.append(temp);
								iDepartment = 2;
							} else {
								bDepartment = false;
							}
						}
						if (bCompany && (iCompany == 1)) {
							if (sCompany.length() <= 15) {
								sCompany.append(temp);
								iCompany = 2;
							} else {
								bCompany = false;
							}
						}
						if (bCompany && (iCompany == 3)) {
							if (sCompany.length() == 0) {
								sCompany.append(temp);
								iCompany = 0;
								bCompany = false;
							}
						}
						// if (bTitle && (iTitle == 1))
						// {
						// if(sTitle.length()<=10)
						// {
						// sTitle.append(temp);
						// iTitle = 2;
						// }else{
						// bTitle = false;
						// }
						// }
						if (bTitle && (iTitle == 3)) {
							// System.out.println("find title");
							if (sTitle.length() == 0) {
								// System.out.println("add title");
								sTitle.append(temp);
								iTitle = 0;
								bTitle = false;
							}
						}
						if (bReport && (iReport == 1)) {
							sReport.append(temp);
							iReport = 2;
						}
						if (bMember && (iMember == 1)) {
							sMember.append(temp);
							iMember = 2;
						}
						if (bDuty && (iDuty == 1)) {
							sDuty.append(temp);
							iDuty = 2;
						}
						if (bOther && (iOther == 1)) {
							sOther.append(temp);
							iOther = 2;
						}
						if (bAchieve && (iAchieve == 1)) {
							sAchieve.append(temp);
							iAchieve = 2;
						}
						if (bReason && (iReason == 1)) {
							sReason.append(temp);
							iReason = 2;
						}
						if (bCity && (iCity == 1)) {
							if (sCity.length() <= 8) {
								sCity.append(temp);
								iCity = 2;
							} else {
								bCity = false;
							}
						}
					}
					Job jobinfo = new Job();
					String text = sList.get(i);
					jobinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					jobinfo.setEndTime(getStartTime(textSen));
					jobinfo.setAchieve(sAchieve.toString());
					jobinfo.setCity(sCity.toString());
					jobinfo.setCompany(sCompany.toString());
					if (jobinfo.getCompany().length() > 50) {
						jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
					}
					jobinfo.setDuty(sDuty.toString());
					jobinfo.setDepartment(sDepartment.toString());
					jobinfo.setReport(sReport.toString());
					jobinfo.setReason(sReason.toString());
					jobinfo.setMember(sMember.toString());
					jobinfo.setTitle(sTitle.toString());
					if (jobinfo.getTitle().length() > 12) {
						jobinfo.setTitle(jobinfo.getTitle().substring(0, 11));
					}
					jobinfo.setInfo(
							sDepartment.toString() + sReport.toString() + sDuty.toString() + sReason.toString());
					if (jobinfo.getInfo() != null && !jobinfo.getInfo().trim().equals("")) {
						jobinfo.setDuty(jobinfo.getInfo());
					}
					// jobinfo.setJobInfo(info.trim());
					// System.out.println("jobinfo" + jobinfo.toString() );
					if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
						String tempjob = job;
						Pattern pattern1 = Pattern.compile( //
								"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
										+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
										+ "((19\\d{2}|20\\d{2})\\s*年)|" //
										+ "((19\\d{2}|20\\d{2}))");
						Matcher matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							String str = matcher1.group();
							tempjob = tempjob.replaceAll(str, "");
							// tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—",
							// "");
						}
						// System.out.println("tempjob = " + tempjob);
						tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
						// System.out.println("tempjob = " + tempjob);
						tempjob = tempjob.replaceFirst("至", "");
						pattern1 = Pattern.compile("股份有限公司|有限责任公司|有限公司");
						matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							jobinfo.setCompany(tempjob.substring(0, matcher1.start()) + matcher1.group());
							break;
						}
						if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
							if (jobinfo.getTitle() == null || jobinfo.getTitle().equals("")) {

							} else {
								List<Integer> iList1 = new ArrayList<Integer>();
								List<String> sList1 = new ArrayList<String>();
								tempjob = job;
								pattern1 = Pattern.compile( //
										"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
												+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
												+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
												+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
												+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
												+ "((19\\d{2}|20\\d{2})\\s*年)|" //
												+ "((19\\d{2}|20\\d{2}))");
								matcher1 = pattern1.matcher(tempjob);
								while (matcher1.find()) {
									String str = matcher1.group();
									tempjob = tempjob.replaceAll(str, "");
									// tempjob =
									// tempjob.replaceAll("-|\\/|\\|\\.|—", "");
								}
								// System.out.println("tempjob = " + tempjob);
								tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
								// System.out.println("tempjob = " + tempjob);
								tempjob = tempjob.replaceFirst("至", "");
								pattern1 = Pattern.compile(jobinfo.getTitle());
								matcher1 = pattern1.matcher(tempjob);
								while (matcher1.find()) {
									jobinfo.setCompany(tempjob.substring(0, matcher1.start()));
									if (jobinfo.getCompany().length() > 50) {
										jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
									}
									break;
								}
							}
						}
					}
					if (jobinfo.getCompany().length() > 250) {
						jobinfo.setCompany(jobinfo.getCompany().substring(0, 250));
					}
					jList.add(jobinfo);
					jobinfo.setCandidateid(id);
					jobinfo.setUpdateTime(new Date());
					dao.insertJob(jobinfo);
					sDepartment = sAchieve = sCity = sCompany = sDuty = sMember = sReport = sReason = sMember = sTitle = null;
					jobinfo = null;
				} else if (i < len - 3) {
					iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther = iAchieve = iReason = iCity = 0;
					bDepartment = bCompany = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
					StringBuffer sCompany = new StringBuffer();
					StringBuffer sTitle = new StringBuffer();
					StringBuffer sReport = new StringBuffer();
					StringBuffer sMember = new StringBuffer();
					StringBuffer sDuty = new StringBuffer();
					StringBuffer sOther = new StringBuffer();
					StringBuffer sAchieve = new StringBuffer();
					StringBuffer sReason = new StringBuffer();
					StringBuffer sCity = new StringBuffer();
					StringBuffer sDepartment = new StringBuffer();
					job = info.substring(iList.get(i), iList.get(i + 2));
					StringReader sr = new StringReader(job);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iDepartment--;
						iCompany--;
						iTitle--;
						iReport--;
						iMember--;
						iDuty--;
						iOther--;
						iAchieve--;
						iReason--;
						iCity--;
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {

							case 15:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 3:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;

							case 14:
								bTitle = true;
								iTitle = 3;
								bDepartment = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 300:
								bMember = true;
								iMember = 2;
								bDepartment = bTitle = bCompany = bReport = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 301:
								bDuty = true;
								iDuty = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bOther = bAchieve = bReason = bCity = false;
								break;
							case 302:
								bAchieve = true;
								iAchieve = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bReason = bCity = false;
								break;
							case 303:
								bReason = true;
								iReason = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bCity = false;
								break;
							case 304:
								bCity = true;
								iCity = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = false;
								break;
							case 306:
								bReport = true;
								iReport = 2;
								bDepartment = bTitle = bCompany = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 307:
								bOther = true;
								iOther = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							case 308:
								bDepartment = true;
								iDepartment = 2;
								bOther = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							default:
								break;
							}
						}
						if (bDepartment && (iDepartment == 1)) {
							if (sDepartment.length() <= 10) {
								sDepartment.append(temp);
								iDepartment = 2;
							} else {
								bDepartment = false;
							}
						}
						if (bCompany && (iCompany == 1)) {
							if (sCompany.length() <= 15) {
								sCompany.append(temp);
								iCompany = 2;
							} else {
								bCompany = false;
							}
						}
						if (bCompany && (iCompany == 3)) {
							if (sCompany.length() == 0) {
								sCompany.append(temp);
								iCompany = 0;
								bCompany = false;
							}
						}

						if (bTitle && (iTitle == 3)) {
							// System.out.println("find title");
							if (sTitle.length() == 0) {
								// System.out.println("add title");
								sTitle.append(temp);
								iTitle = 0;
								bTitle = false;
							}
						}
						if (bReport && (iReport == 1)) {
							sReport.append(temp);
							iReport = 2;
						}
						if (bMember && (iMember == 1)) {
							sMember.append(temp);
							iMember = 2;
						}
						if (bDuty && (iDuty == 1)) {
							sDuty.append(temp);
							iDuty = 2;
						}
						if (bOther && (iOther == 1)) {
							sOther.append(temp);
							iOther = 2;
						}
						if (bAchieve && (iAchieve == 1)) {
							sAchieve.append(temp);
							iAchieve = 2;
						}
						if (bReason && (iReason == 1)) {
							sReason.append(temp);
							iReason = 2;
						}
						if (bCity && (iCity == 1)) {
							if (sCity.length() <= 8) {
								sCity.append(temp);
								iCity = 2;
							} else {
								bCity = false;
							}
						}

					}
					Job jobinfo = new Job();
					String text = sList.get(i);
					jobinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					jobinfo.setEndTime(getStartTime(textSen));
					jobinfo.setAchieve(sAchieve.toString());
					jobinfo.setCity(sCity.toString());
					jobinfo.setCompany(sCompany.toString());
					if (jobinfo.getCompany().length() > 50) {
						jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
					}
					jobinfo.setDuty(sDuty.toString());
					jobinfo.setDepartment(sDepartment.toString());
					jobinfo.setReport(sReport.toString());
					jobinfo.setReason(sReason.toString());
					jobinfo.setMember(sMember.toString());
					jobinfo.setTitle(sTitle.toString());
					if (jobinfo.getTitle().length() > 12) {
						jobinfo.setTitle(jobinfo.getTitle().substring(0, 11));
					}
					jobinfo.setInfo(
							sDepartment.toString() + sReport.toString() + sDuty.toString() + sReason.toString());
					if (jobinfo.getInfo() != null && !jobinfo.getInfo().trim().equals("")) {
						jobinfo.setDuty(jobinfo.getInfo());
					}
					// jobinfo.setJobInfo(info.trim());
					// System.out.println("jobinfo" + jobinfo.toString() );
					if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
						String tempjob = job;
						Pattern pattern1 = Pattern.compile( //
								"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
										+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
										+ "((19\\d{2}|20\\d{2})\\s*年)|" //
										+ "((19\\d{2}|20\\d{2}))");
						Matcher matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							String str = matcher1.group();
							tempjob = tempjob.replaceAll(str, "");
							// tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—",
							// "");
						}
						// System.out.println("tempjob = " + tempjob);
						tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
						// System.out.println("tempjob = " + tempjob);
						tempjob = tempjob.replaceFirst("至", "");
						pattern1 = Pattern.compile("股份有限公司|有限责任公司|有限公司");
						matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							jobinfo.setCompany(tempjob.substring(0, matcher1.start()) + matcher1.group());
							break;
						}
						if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
							if (jobinfo.getTitle() == null || jobinfo.getTitle().equals("")) {

							} else {
								List<Integer> iList1 = new ArrayList<Integer>();
								List<String> sList1 = new ArrayList<String>();
								tempjob = job;
								pattern1 = Pattern.compile( //
										"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
												+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
												+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
												+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
												+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
												+ "((19\\d{2}|20\\d{2})\\s*年)|" //
												+ "((19\\d{2}|20\\d{2}))");
								matcher1 = pattern1.matcher(tempjob);
								while (matcher1.find()) {
									String str = matcher1.group();
									tempjob = tempjob.replaceAll(str, "");
									// tempjob =
									// tempjob.replaceAll("-|\\/|\\|\\.|—", "");
								}
								// System.out.println("tempjob = " + tempjob);
								tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
								// System.out.println("tempjob = " + tempjob);
								tempjob = tempjob.replaceFirst("至", "");
								pattern1 = Pattern.compile(jobinfo.getTitle());
								matcher1 = pattern1.matcher(tempjob);
								while (matcher1.find()) {
									jobinfo.setCompany(tempjob.substring(0, matcher1.start()));
									if (jobinfo.getCompany().length() > 50) {
										jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
									}
									break;
								}
							}
						}
					}
					if (jobinfo.getCompany().length() > 250) {
						jobinfo.setCompany(jobinfo.getCompany().substring(0, 250));
					}
					jList.add(jobinfo);
					jobinfo.setCandidateid(id);
					jobinfo.setUpdateTime(new Date());
					dao.insertJob(jobinfo);
					sDepartment = sAchieve = sCity = sCompany = sDuty = sMember = sReport = sReason = sMember = sTitle = null;
					jobinfo = null;
				} else {
					iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther = iAchieve = iReason = iCity = 0;
					bDepartment = bCompany = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
					StringBuffer sCompany = new StringBuffer();
					StringBuffer sTitle = new StringBuffer();
					StringBuffer sReport = new StringBuffer();
					StringBuffer sMember = new StringBuffer();
					StringBuffer sDuty = new StringBuffer();
					StringBuffer sOther = new StringBuffer();
					StringBuffer sAchieve = new StringBuffer();
					StringBuffer sReason = new StringBuffer();
					StringBuffer sCity = new StringBuffer();
					StringBuffer sDepartment = new StringBuffer();
					job = info.substring(iList.get(i), length);
					StringReader sr = new StringReader(job);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iDepartment--;
						iCompany--;
						iTitle--;
						iReport--;
						iMember--;
						iDuty--;
						iOther--;
						iAchieve--;
						iReason--;
						iCity--;
						temp = lex.getLexemeText();
						// System.out.println(temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {

							case 15:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 3:
								bCompany = true;
								iCompany = 3;
								bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;

							case 14:
								bTitle = true;
								iTitle = 3;
								bDepartment = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 300:
								bMember = true;
								iMember = 2;
								bDepartment = bTitle = bCompany = bReport = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 301:
								bDuty = true;
								iDuty = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bOther = bAchieve = bReason = bCity = false;
								break;
							case 302:
								bAchieve = true;
								iAchieve = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bReason = bCity = false;
								break;
							case 303:
								bReason = true;
								iReason = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bCity = false;
								break;
							case 304:
								bCity = true;
								iCity = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = false;
								break;
							case 306:
								bReport = true;
								iReport = 2;
								bDepartment = bTitle = bCompany = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
								break;
							case 307:
								bOther = true;
								iOther = 2;
								bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							case 308:
								bDepartment = true;
								iDepartment = 2;
								bOther = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
								break;
							default:
								break;
							}
						}
						if (bDepartment && (iDepartment == 1)) {
							if (sDepartment.length() <= 10) {
								sDepartment.append(temp);
								iDepartment = 2;
							} else {
								bDepartment = false;
							}
						}
						if (bCompany && (iCompany == 1)) {
							if (sCompany.length() <= 15) {
								sCompany.append(temp);
								iCompany = 2;
							} else {
								bCompany = false;
							}
						}
						if (bCompany && (iCompany == 3)) {
							if (sCompany.length() == 0) {
								sCompany.append(temp);
								iCompany = 0;
								bCompany = false;
							}
						}

						if (bTitle && (iTitle == 3)) {
							// System.out.println("find title");
							if (sTitle.length() == 0) {
								// System.out.println("add title");
								sTitle.append(temp);
								iTitle = 0;
								bTitle = false;
							}
						}
						if (bReport && (iReport == 1)) {
							sReport.append(temp);
							iReport = 2;
						}
						if (bMember && (iMember == 1)) {
							sMember.append(temp);
							iMember = 2;
						}
						if (bDuty && (iDuty == 1)) {
							sDuty.append(temp);
							iDuty = 2;
						}
						if (bOther && (iOther == 1)) {
							sOther.append(temp);
							iOther = 2;
						}
						if (bAchieve && (iAchieve == 1)) {
							sAchieve.append(temp);
							iAchieve = 2;
						}
						if (bReason && (iReason == 1)) {
							sReason.append(temp);
							iReason = 2;
						}
						if (bCity && (iCity == 1)) {
							if (sCity.length() <= 8) {
								sCity.append(temp);
								iCity = 2;
							} else {
								bCity = false;
							}
						}
					}
					Job jobinfo = new Job();
					String text = sList.get(i);
					jobinfo.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					jobinfo.setEndTime(getStartTime(textSen));
					jobinfo.setAchieve(sAchieve.toString());
					jobinfo.setCity(sCity.toString());
					jobinfo.setCompany(sCompany.toString());
					if (jobinfo.getCompany().length() > 50) {
						jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
					}
					jobinfo.setDuty(sDuty.toString());
					jobinfo.setDepartment(sDepartment.toString());
					jobinfo.setReport(sReport.toString());
					jobinfo.setReason(sReason.toString());
					jobinfo.setMember(sMember.toString());
					jobinfo.setTitle(sTitle.toString());
					if (jobinfo.getTitle().length() > 12) {
						jobinfo.setTitle(jobinfo.getTitle().substring(0, 11));
					}
					jobinfo.setInfo(
							sDepartment.toString() + sReport.toString() + sDuty.toString() + sReason.toString());
					jobinfo.setJobInfo(info.trim());
					// System.out.println("jobinfo" + jobinfo.toString() );
					if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
						String tempjob = job;
						Pattern pattern1 = Pattern.compile( //
								"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
										+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
										+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
										+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
										+ "((19\\d{2}|20\\d{2})\\s*年)|" //
										+ "((19\\d{2}|20\\d{2}))");
						Matcher matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							String str = matcher1.group();
							tempjob = tempjob.replaceAll(str, "");
							// tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—",
							// "");
						}
						// System.out.println("tempjob = " + tempjob);
						tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
						// System.out.println("tempjob = " + tempjob);
						tempjob = tempjob.replaceFirst("至", "");
						pattern1 = Pattern.compile("股份有限公司|有限责任公司|有限公司");
						matcher1 = pattern1.matcher(tempjob);
						while (matcher1.find()) {
							jobinfo.setCompany(tempjob.substring(0, matcher1.start()) + matcher1.group());
							break;
						}
						if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
							if (jobinfo.getTitle() == null || jobinfo.getTitle().equals("")) {

							} else {
								List<Integer> iList1 = new ArrayList<Integer>();
								List<String> sList1 = new ArrayList<String>();
								tempjob = job;
								pattern1 = Pattern.compile( //
										"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
												+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
												+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
												+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
												+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
												+ "((19\\d{2}|20\\d{2})\\s*年)|" //
												+ "((19\\d{2}|20\\d{2}))");
								matcher1 = pattern1.matcher(tempjob);
								while (matcher1.find()) {
									String str = matcher1.group();
									tempjob = tempjob.replaceAll(str, "");
									// tempjob =
									// tempjob.replaceAll("-|\\/|\\|\\.|—", "");
								}
								// System.out.println("tempjob = " + tempjob);
								tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
								// System.out.println("tempjob = " + tempjob);
								tempjob = tempjob.replaceFirst("至", "");
								pattern1 = Pattern.compile(jobinfo.getTitle());
								matcher1 = pattern1.matcher(tempjob);
								while (matcher1.find()) {
									jobinfo.setCompany(tempjob.substring(0, matcher1.start()));
									if (jobinfo.getCompany().length() > 50) {
										jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
									}
									break;
								}
							}
						}
					}
					if (jobinfo.getCompany().length() > 250) {
						jobinfo.setCompany(jobinfo.getCompany().substring(0, 250));
					}
					jList.add(jobinfo);
					jobinfo.setCandidateid(id);
					jobinfo.setUpdateTime(new Date());
					dao.insertJob(jobinfo);
					sDepartment = sAchieve = sCity = sCompany = sDuty = sMember = sReport = sReason = sMember = sTitle = null;
					jobinfo = null;
				}
			} else {
				iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther = iAchieve = iReason = iCity = 0;
				bDepartment = bCompany = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
				StringBuffer sCompany = new StringBuffer();
				StringBuffer sTitle = new StringBuffer();
				StringBuffer sReport = new StringBuffer();
				StringBuffer sMember = new StringBuffer();
				StringBuffer sDuty = new StringBuffer();
				StringBuffer sOther = new StringBuffer();
				StringBuffer sAchieve = new StringBuffer();
				StringBuffer sReason = new StringBuffer();
				StringBuffer sCity = new StringBuffer();
				StringBuffer sDepartment = new StringBuffer();
				job = info.substring(0, length);
				StringReader sr = new StringReader(job);
				IKSegmenter ik = new IKSegmenter(sr, true);
				while ((lex = ik.next()) != null) {
					iDepartment--;
					iCompany--;
					iTitle--;
					iReport--;
					iMember--;
					iDuty--;
					iOther--;
					iAchieve--;
					iReason--;
					iCity--;
					temp = lex.getLexemeText();
					// System.out.println(temp);
					if (m_UserDic.containsKey(temp)) {
						type = m_UserDic.get(temp);
						switch (type) {

						case 15:
							bCompany = true;
							iCompany = 3;
							bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						case 3:
							bCompany = true;
							iCompany = 3;
							bDepartment = bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;

						case 14:
							bTitle = true;
							iTitle = 3;
							bDepartment = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						case 300:
							bMember = true;
							iMember = 2;
							bDepartment = bTitle = bCompany = bReport = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						case 301:
							bDuty = true;
							iDuty = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bOther = bAchieve = bReason = bCity = false;
							break;
						case 302:
							bAchieve = true;
							iAchieve = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bReason = bCity = false;
							break;
						case 303:
							bReason = true;
							iReason = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bCity = false;
							break;
						case 304:
							bCity = true;
							iCity = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bOther = bAchieve = bReason = false;
							break;
						case 306:
							bReport = true;
							iReport = 2;
							bDepartment = bTitle = bCompany = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
							break;
						case 307:
							bOther = true;
							iOther = 2;
							bDepartment = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
							break;
						case 308:
							bDepartment = true;
							iDepartment = 2;
							bOther = bTitle = bCompany = bReport = bMember = bDuty = bAchieve = bReason = bCity = false;
							break;
						default:
							break;
						}
					}
					if (bDepartment && (iDepartment == 1)) {
						if (sDepartment.length() <= 10) {
							sDepartment.append(temp);
							iDepartment = 2;
						} else {
							bDepartment = false;
						}
					}
					if (bCompany && (iCompany == 1)) {
						if (sCompany.length() <= 15) {
							sCompany.append(temp);
							iCompany = 2;
						} else {
							bCompany = false;
						}
					}
					if (bCompany && (iCompany == 3)) {
						// System.out.println("find title");
						if (sCompany.length() == 0) {
							// System.out.println("add title");
							sCompany.append(temp);
							iCompany = 0;
							bCompany = false;
						}
					}

					if (bTitle && (iTitle == 3)) {
						if (sTitle.length() == 0) {
							sTitle.append(temp);
							iTitle = 0;
							bTitle = false;
						}
					}
					if (bReport && (iReport == 1)) {
						sReport.append(temp);
						iReport = 2;
					}
					if (bMember && (iMember == 1)) {
						sMember.append(temp);
						iMember = 2;
					}
					if (bDuty && (iDuty == 1)) {
						sDuty.append(temp);
						iDuty = 2;
					}
					if (bOther && (iOther == 1)) {
						sOther.append(temp);
						iOther = 2;
					}
					if (bAchieve && (iAchieve == 1)) {
						sAchieve.append(temp);
						iAchieve = 2;
					}
					if (bReason && (iReason == 1)) {
						sReason.append(temp);
						iReason = 2;
					}
					if (bCity && (iCity == 1)) {
						if (sCity.length() <= 8) {
							sCity.append(temp);
							iCity = 2;
						} else {
							bCity = false;
						}
					}
				}
				Job jobinfo = new Job();
				String text = sList.get(i);
				jobinfo.setStartTime(getStartTime(text));
				String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
				jobinfo.setEndTime(getStartTime(textSen));
				jobinfo.setAchieve(sAchieve.toString());
				jobinfo.setCity(sCity.toString());
				jobinfo.setCompany(sCompany.toString());
				if (jobinfo.getCompany().length() > 50) {
					jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
				}
				jobinfo.setDuty(sDuty.toString());
				jobinfo.setDepartment(sDepartment.toString());
				jobinfo.setReport(sReport.toString());
				jobinfo.setReason(sReason.toString());
				jobinfo.setMember(sMember.toString());
				jobinfo.setTitle(sTitle.toString());
				if (jobinfo.getTitle().length() > 12) {
					jobinfo.setTitle(jobinfo.getTitle().substring(0, 11));
				}
				jobinfo.setInfo(sDepartment.toString() + sReport.toString() + sDuty.toString() + sReason.toString());
				jobinfo.setJobInfo(info.trim());
				// System.out.println("jobinfo" + jobinfo.toString() );
				if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
					String tempjob = job;
					Pattern pattern1 = Pattern.compile( //
							"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
									+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
									+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
									+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
									+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
									+ "((19\\d{2}|20\\d{2})\\s*年)|" //
									+ "((19\\d{2}|20\\d{2}))");
					Matcher matcher1 = pattern1.matcher(tempjob);
					while (matcher1.find()) {
						String str = matcher1.group();
						tempjob = tempjob.replaceAll(str, "");
						// tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—", "");
					}
					// System.out.println("tempjob = " + tempjob);
					tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
					// System.out.println("tempjob = " + tempjob);
					tempjob = tempjob.replaceFirst("至", "");
					pattern1 = Pattern.compile("股份有限公司|有限责任公司|有限公司");
					matcher1 = pattern1.matcher(tempjob);
					while (matcher1.find()) {
						jobinfo.setCompany(tempjob.substring(0, matcher1.start()) + matcher1.group());
						break;
					}
					if (jobinfo.getCompany() == null || jobinfo.getCompany().equals("")) {
						if (jobinfo.getTitle() == null || jobinfo.getTitle().equals("")) {

						} else {
							List<Integer> iList1 = new ArrayList<Integer>();
							List<String> sList1 = new ArrayList<String>();
							tempjob = job;
							pattern1 = Pattern.compile( //
									"((19\\d{2}|20\\d{2})\\s*-\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\/\\s*\\d{1,2})|" //
											+ "((19\\d{2}|20\\d{2})\\s*年\\s*\\d{1,2}\\s*月)|" //
											+ "((19\\d{2}|20\\d{2})\\s*\\.\\s*\\d{1,2})|" //
											+ "现\\s*在|至\\s*今|到\\s*现\\s*在|目\\s*前 |今|" //
											+ "((19\\d{2}|20\\d{2})\\s*年)|" //
											+ "((19\\d{2}|20\\d{2}))");
							matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								String str = matcher1.group();
								tempjob = tempjob.replaceAll(str, "");
								// tempjob =
								// tempjob.replaceAll("-|\\/|\\|\\.|—", "");
							}
							// System.out.println("tempjob = " + tempjob);
							tempjob = tempjob.replaceAll("-|\\/|\\|\\.|—|–|～", "");
							// System.out.println("tempjob = " + tempjob);
							tempjob = tempjob.replaceFirst("至", "");
							pattern1 = Pattern.compile(jobinfo.getTitle());
							matcher1 = pattern1.matcher(tempjob);
							while (matcher1.find()) {
								jobinfo.setCompany(tempjob.substring(0, matcher1.start()));
								if (jobinfo.getCompany().length() > 50) {
									jobinfo.setCompany(jobinfo.getCompany().substring(0, 49));
								}
								break;
							}
						}
					}
				}
				if (jobinfo.getCompany().length() > 250) {
					jobinfo.setCompany(jobinfo.getCompany().substring(0, 250));
				}
				jList.add(jobinfo);
				jobinfo.setCandidateid(id);
				jobinfo.setUpdateTime(new Date());
				dao.insertJob(jobinfo);
				sDepartment = sAchieve = sCity = sCompany = sDuty = sMember = sReport = sReason = sMember = sTitle = null;
				jobinfo = null;
			}
			i += 2;
		}
		map.setJobs(jList);
		iList = null;
		sList = null;
		jList = null;
	}
	// */

	/*
	 * private void parseJobBehind(int id ,String info,IDatabaseDao dao) throws
	 * IOException { List<Integer> iList = new ArrayList<Integer>();
	 * List<String> sList = new ArrayList<String>(); Pattern pattern = Pattern
	 * .compile(
	 * "((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前"
	 * ); Matcher matcher = pattern.matcher(info); while (matcher.find()) {
	 * String str = matcher.group(); sList.add(str); iList.add(matcher.start());
	 * } Pattern pyear = Pattern.compile("\\d{4}"); Pattern pMonth =
	 * Pattern.compile("\\d{2}"); Pattern pDay= Pattern.compile("\\d{2}"); int
	 * length = info.length(); String job = ""; Lexeme lex = null; String temp =
	 * ""; int type = 0; int iCompany, iTitle, iReport, iMember, iDuty, iOther,
	 * iAchieve, iReason, iCity,iDepartment; boolean bCompany, bTitle, bReport,
	 * bMember, bDuty, bOther, bAchieve, bReason, bCity,bDepartment; for (int i
	 * = 0, len = iList.size(); i < len;) { if (iList.size() > 2) { if (i == 0)
	 * { iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther =
	 * iAchieve = iReason = iCity = 0; bDepartment = bCompany = bTitle = bReport
	 * = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
	 * StringBuffer sCompany = new StringBuffer(); StringBuffer sTitle = new
	 * StringBuffer(); StringBuffer sReport = new StringBuffer(); StringBuffer
	 * sMember = new StringBuffer(); StringBuffer sDuty = new StringBuffer();
	 * StringBuffer sOther = new StringBuffer(); StringBuffer sAchieve = new
	 * StringBuffer(); StringBuffer sReason = new StringBuffer(); StringBuffer
	 * sCity = new StringBuffer(); StringBuffer sDepartment = new
	 * StringBuffer(); job = info.substring(iList.get(i), iList.get(i + 2));
	 * StringReader sr = new StringReader(job); IKSegmenter ik = new
	 * IKSegmenter(sr, true); while ((lex = ik.next()) != null) { iDepartment--;
	 * iCompany--; iTitle--; iReport--; iMember--; iDuty--; iOther--;
	 * iAchieve--; iReason--; iCity--; temp = lex.getLexemeText(); if
	 * (m_UserDic.containsKey(temp)) { type = m_UserDic.get(temp); switch (type)
	 * { case 208: bCompany = true; iCompany = 2; bDepartment =bTitle = bReport
	 * = bMember = bDuty = bOther = bAchieve = bReason = bCity = false; break;
	 * case 209: bTitle = true; iTitle = 2; bDepartment =bCompany = bReport =
	 * bMember = bDuty = bOther = bAchieve = bReason = bCity = false; break;
	 * case 300: bMember = true; iMember = 2; bDepartment =bTitle = bCompany =
	 * bReport = bDuty = bOther = bAchieve = bReason = bCity = false; break;
	 * case 301: bDuty = true; iDuty = 2; bDepartment =bTitle = bCompany =
	 * bReport = bMember = bOther = bAchieve = bReason = bCity = false; break;
	 * case 302: bAchieve = true; iAchieve = 2; bDepartment =bTitle = bCompany =
	 * bReport = bMember = bDuty = bOther = bReason = bCity = false; break; case
	 * 303: bReason = true; iReason = 2; bDepartment =bTitle = bCompany =
	 * bReport = bMember = bDuty = bOther = bAchieve = bCity = false; break;
	 * case 304: bCity = true; iCity = 2; bDepartment =bTitle = bCompany =
	 * bReport = bMember = bDuty = bOther = bAchieve = bReason = false; break;
	 * case 306: bReport = true; iReport = 2; bDepartment =bTitle = bCompany =
	 * bMember = bDuty = bOther = bAchieve = bReason = bCity = false; break;
	 * case 307: bOther = true; iOther = 2; bDepartment =bTitle = bCompany =
	 * bReport = bMember = bDuty = bAchieve = bReason = bCity = false; break;
	 * case 308: bDepartment = true; iDepartment = 2; bOther =bTitle = bCompany
	 * = bReport = bMember = bDuty = bAchieve = bReason = bCity = false; break;
	 * default: break; } } if (bDepartment&& (iDepartment== 1)) {
	 * sDepartment.append(temp); iDepartment = 2; } if (bCompany && (iCompany ==
	 * 1)) { sCompany.append(temp); iCompany = 2; } if (bTitle && (iTitle == 1))
	 * { sTitle.append(temp); iTitle = 2; } if (bReport && (iReport == 1)) {
	 * sReport.append(temp); iReport = 2; } if (bMember && (iMember == 1)) {
	 * sMember.append(temp); iMember = 2; } if (bDuty && (iDuty == 1)) {
	 * sDuty.append(temp); iDuty = 2; } if (bOther && (iOther == 1)) {
	 * sOther.append(temp); iOther = 2; } if (bAchieve && (iAchieve == 1)) {
	 * sAchieve.append(temp); iAchieve = 2; } if (bReason && (iReason == 1)) {
	 * sReason.append(temp); iReason = 2; } if (bCity && (iCity == 1)) {
	 * sCity.append(temp); iCity = 2; } } Job jobinfo = new Job(); String text =
	 * sList.get(i); jobinfo.setStartTime(getStartTime(text)); String textSen =
	 * (i + 1)>=sList.size()?"":sList.get(i + 1);
	 * jobinfo.setEndTime(getStartTime(textSen));
	 * jobinfo.setAchieve(sAchieve.toString());
	 * jobinfo.setCity(sCity.toString());
	 * jobinfo.setCompany(sCompany.toString());
	 * jobinfo.setDuty(sDuty.toString());
	 * jobinfo.setDepartment(sDepartment.toString()); jobinfo.setReport(
	 * sReport.toString()); jobinfo.setReason(sReason.toString());
	 * jobinfo.setMember(sMember.toString());
	 * jobinfo.setTitle(sTitle.toString()); jobinfo.setJobInfo(info.trim());
	 * jobinfo.setCandidateid(id); jobinfo.setUpdateTime(new Date());
	 * dao.insertJob(jobinfo); sDepartment = sAchieve = sCity = sCompany=sDuty
	 * =sMember= sReport= sReason =sMember=sTitle= null; jobinfo = null ; } else
	 * if (i < len - 3) { iDepartment = iCompany = iTitle = iReport = iMember =
	 * iDuty = iOther = iAchieve = iReason = iCity = 0; bDepartment = bCompany =
	 * bTitle = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity
	 * = false; StringBuffer sCompany = new StringBuffer(); StringBuffer sTitle
	 * = new StringBuffer(); StringBuffer sReport = new StringBuffer();
	 * StringBuffer sMember = new StringBuffer(); StringBuffer sDuty = new
	 * StringBuffer(); StringBuffer sOther = new StringBuffer(); StringBuffer
	 * sAchieve = new StringBuffer(); StringBuffer sReason = new StringBuffer();
	 * StringBuffer sCity = new StringBuffer(); StringBuffer sDepartment = new
	 * StringBuffer(); job = info.substring(iList.get(i), iList.get(i + 2));
	 * StringReader sr = new StringReader(job); IKSegmenter ik = new
	 * IKSegmenter(sr, true); while ((lex = ik.next()) != null) { iDepartment--;
	 * iCompany--; iTitle--; iReport--; iMember--; iDuty--; iOther--;
	 * iAchieve--; iReason--; iCity--; temp = lex.getLexemeText(); if
	 * (m_UserDic.containsKey(temp)) { type = m_UserDic.get(temp); switch (type)
	 * { case 208: bCompany = true; iCompany = 2; bDepartment =bTitle = bReport
	 * = bMember = bDuty = bOther = bAchieve = bReason = bCity = false; break;
	 * case 209: bTitle = true; iTitle = 2; bDepartment =bCompany = bReport =
	 * bMember = bDuty = bOther = bAchieve = bReason = bCity = false; break;
	 * case 300: bMember = true; iMember = 2; bDepartment =bTitle = bCompany =
	 * bReport = bDuty = bOther = bAchieve = bReason = bCity = false; break;
	 * case 301: bDuty = true; iDuty = 2; bDepartment =bTitle = bCompany =
	 * bReport = bMember = bOther = bAchieve = bReason = bCity = false; break;
	 * case 302: bAchieve = true; iAchieve = 2; bDepartment =bTitle = bCompany =
	 * bReport = bMember = bDuty = bOther = bReason = bCity = false; break; case
	 * 303: bReason = true; iReason = 2; bDepartment =bTitle = bCompany =
	 * bReport = bMember = bDuty = bOther = bAchieve = bCity = false; break;
	 * case 304: bCity = true; iCity = 2; bDepartment =bTitle = bCompany =
	 * bReport = bMember = bDuty = bOther = bAchieve = bReason = false; break;
	 * case 306: bReport = true; iReport = 2; bDepartment =bTitle = bCompany =
	 * bMember = bDuty = bOther = bAchieve = bReason = bCity = false; break;
	 * case 307: bOther = true; iOther = 2; bDepartment =bTitle = bCompany =
	 * bReport = bMember = bDuty = bAchieve = bReason = bCity = false; break;
	 * case 308: bDepartment = true; iDepartment = 2; bOther =bTitle = bCompany
	 * = bReport = bMember = bDuty = bAchieve = bReason = bCity = false; break;
	 * default: break; } } if (bDepartment&& (iDepartment== 1)) {
	 * sDepartment.append(temp); iDepartment = 2; } if (bCompany && (iCompany ==
	 * 1)) { sCompany.append(temp); iCompany = 2; } if (bTitle && (iTitle == 1))
	 * { sTitle.append(temp); iTitle = 2; } if (bReport && (iReport == 1)) {
	 * sReport.append(temp); iReport = 2; } if (bMember && (iMember == 1)) {
	 * sMember.append(temp); iMember = 2; } if (bDuty && (iDuty == 1)) {
	 * sDuty.append(temp); iDuty = 2; } if (bOther && (iOther == 1)) {
	 * sOther.append(temp); iOther = 2; } if (bAchieve && (iAchieve == 1)) {
	 * sAchieve.append(temp); iAchieve = 2; } if (bReason && (iReason == 1)) {
	 * sReason.append(temp); iReason = 2; } if (bCity && (iCity == 1)) {
	 * sCity.append(temp); iCity = 2; } } Job jobinfo = new Job(); String text =
	 * sList.get(i); jobinfo.setStartTime(getStartTime(text)); String textSen =
	 * (i + 1)>=sList.size()?"":sList.get(i + 1);
	 * jobinfo.setEndTime(getStartTime(textSen));
	 * jobinfo.setAchieve(sAchieve.toString());
	 * jobinfo.setCity(sCity.toString());
	 * jobinfo.setCompany(sCompany.toString());
	 * jobinfo.setDuty(sDuty.toString());
	 * jobinfo.setDepartment(sDepartment.toString()); jobinfo.setReport(
	 * sReport.toString()); jobinfo.setReason(sReason.toString());
	 * jobinfo.setMember(sMember.toString());
	 * jobinfo.setTitle(sTitle.toString()); jobinfo.setJobInfo(info.trim());
	 * jobinfo.setCandidateid(id); jobinfo.setUpdateTime(new Date());
	 * dao.insertJob(jobinfo); sDepartment =sAchieve = sCity = sCompany=sDuty
	 * =sMember= sReport= sReason =sMember=sTitle= null; jobinfo = null ; } else
	 * { iDepartment = iCompany = iTitle = iReport = iMember = iDuty = iOther =
	 * iAchieve = iReason = iCity = 0; bDepartment = bCompany = bTitle = bReport
	 * = bMember = bDuty = bOther = bAchieve = bReason = bCity = false;
	 * StringBuffer sCompany = new StringBuffer(); StringBuffer sTitle = new
	 * StringBuffer(); StringBuffer sReport = new StringBuffer(); StringBuffer
	 * sMember = new StringBuffer(); StringBuffer sDuty = new StringBuffer();
	 * StringBuffer sOther = new StringBuffer(); StringBuffer sAchieve = new
	 * StringBuffer(); StringBuffer sReason = new StringBuffer(); StringBuffer
	 * sCity = new StringBuffer(); StringBuffer sDepartment = new
	 * StringBuffer(); job = info.substring(iList.get(i), length); StringReader
	 * sr = new StringReader(job); IKSegmenter ik = new IKSegmenter(sr, true);
	 * while ((lex = ik.next()) != null) { iDepartment--; iCompany--; iTitle--;
	 * iReport--; iMember--; iDuty--; iOther--; iAchieve--; iReason--; iCity--;
	 * temp = lex.getLexemeText(); if (m_UserDic.containsKey(temp)) { type =
	 * m_UserDic.get(temp); switch (type) { case 208: bCompany = true; iCompany
	 * = 2; bDepartment =bTitle = bReport = bMember = bDuty = bOther = bAchieve
	 * = bReason = bCity = false; break; case 209: bTitle = true; iTitle = 2;
	 * bDepartment =bCompany = bReport = bMember = bDuty = bOther = bAchieve =
	 * bReason = bCity = false; break; case 300: bMember = true; iMember = 2;
	 * bDepartment =bTitle = bCompany = bReport = bDuty = bOther = bAchieve =
	 * bReason = bCity = false; break; case 301: bDuty = true; iDuty = 2;
	 * bDepartment =bTitle = bCompany = bReport = bMember = bOther = bAchieve =
	 * bReason = bCity = false; break; case 302: bAchieve = true; iAchieve = 2;
	 * bDepartment =bTitle = bCompany = bReport = bMember = bDuty = bOther =
	 * bReason = bCity = false; break; case 303: bReason = true; iReason = 2;
	 * bDepartment =bTitle = bCompany = bReport = bMember = bDuty = bOther =
	 * bAchieve = bCity = false; break; case 304: bCity = true; iCity = 2;
	 * bDepartment =bTitle = bCompany = bReport = bMember = bDuty = bOther =
	 * bAchieve = bReason = false; break; case 306: bReport = true; iReport = 2;
	 * bDepartment =bTitle = bCompany = bMember = bDuty = bOther = bAchieve =
	 * bReason = bCity = false; break; case 307: bOther = true; iOther = 2;
	 * bDepartment =bTitle = bCompany = bReport = bMember = bDuty = bAchieve =
	 * bReason = bCity = false; break; case 308: bDepartment = true; iDepartment
	 * = 2; bOther =bTitle = bCompany = bReport = bMember = bDuty = bAchieve =
	 * bReason = bCity = false; break; default: break; } } if (bDepartment&&
	 * (iDepartment== 1)) { sDepartment.append(temp); iDepartment = 2; } if
	 * (bCompany && (iCompany == 1)) { sCompany.append(temp); iCompany = 2; } if
	 * (bTitle && (iTitle == 1)) { sTitle.append(temp); iTitle = 2; } if
	 * (bReport && (iReport == 1)) { sReport.append(temp); iReport = 2; } if
	 * (bMember && (iMember == 1)) { sMember.append(temp); iMember = 2; } if
	 * (bDuty && (iDuty == 1)) { sDuty.append(temp); iDuty = 2; } if (bOther &&
	 * (iOther == 1)) { sOther.append(temp); iOther = 2; } if (bAchieve &&
	 * (iAchieve == 1)) { sAchieve.append(temp); iAchieve = 2; } if (bReason &&
	 * (iReason == 1)) { sReason.append(temp); iReason = 2; } if (bCity &&
	 * (iCity == 1)) { sCity.append(temp); iCity = 2; } } Job jobinfo = new
	 * Job(); String text = sList.get(i);
	 * jobinfo.setStartTime(getStartTime(text)); String textSen = (i +
	 * 1)>=sList.size()?"":sList.get(i + 1);
	 * jobinfo.setEndTime(getStartTime(textSen));
	 * jobinfo.setAchieve(sAchieve.toString());
	 * jobinfo.setCity(sCity.toString());
	 * jobinfo.setCompany(sCompany.toString());
	 * jobinfo.setDuty(sDuty.toString());
	 * jobinfo.setDepartment(sDepartment.toString()); jobinfo.setReport(
	 * sReport.toString()); jobinfo.setReason( sReason.toString());
	 * jobinfo.setMember(sMember.toString());
	 * jobinfo.setTitle(sTitle.toString()); jobinfo.setJobInfo(info.trim());
	 * jobinfo.setCandidateid(id); jobinfo.setUpdateTime(new Date());
	 * dao.insertJob(jobinfo); sDepartment = sAchieve = sCity = sCompany=sDuty
	 * =sMember= sReport= sReason =sMember=sTitle= null; jobinfo = null ; } }
	 * else { iDepartment = iCompany = iTitle = iReport = iMember = iDuty =
	 * iOther = iAchieve = iReason = iCity = 0; bDepartment = bCompany = bTitle
	 * = bReport = bMember = bDuty = bOther = bAchieve = bReason = bCity =
	 * false; StringBuffer sCompany = new StringBuffer(); StringBuffer sTitle =
	 * new StringBuffer(); StringBuffer sReport = new StringBuffer();
	 * StringBuffer sMember = new StringBuffer(); StringBuffer sDuty = new
	 * StringBuffer(); StringBuffer sOther = new StringBuffer(); StringBuffer
	 * sAchieve = new StringBuffer(); StringBuffer sReason = new StringBuffer();
	 * StringBuffer sCity = new StringBuffer(); StringBuffer sDepartment = new
	 * StringBuffer(); job = info.substring(0, length); StringReader sr = new
	 * StringReader(job); IKSegmenter ik = new IKSegmenter(sr, true); while
	 * ((lex = ik.next()) != null) { iDepartment--; iCompany--; iTitle--;
	 * iReport--; iMember--; iDuty--; iOther--; iAchieve--; iReason--; iCity--;
	 * temp = lex.getLexemeText(); if (m_UserDic.containsKey(temp)) { type =
	 * m_UserDic.get(temp); switch (type) { case 208: bCompany = true; iCompany
	 * = 2; bDepartment =bTitle = bReport = bMember = bDuty = bOther = bAchieve
	 * = bReason = bCity = false; break; case 209: bTitle = true; iTitle = 2;
	 * bDepartment =bCompany = bReport = bMember = bDuty = bOther = bAchieve =
	 * bReason = bCity = false; break; case 300: bMember = true; iMember = 2;
	 * bDepartment =bTitle = bCompany = bReport = bDuty = bOther = bAchieve =
	 * bReason = bCity = false; break; case 301: bDuty = true; iDuty = 2;
	 * bDepartment =bTitle = bCompany = bReport = bMember = bOther = bAchieve =
	 * bReason = bCity = false; break; case 302: bAchieve = true; iAchieve = 2;
	 * bDepartment =bTitle = bCompany = bReport = bMember = bDuty = bOther =
	 * bReason = bCity = false; break; case 303: bReason = true; iReason = 2;
	 * bDepartment =bTitle = bCompany = bReport = bMember = bDuty = bOther =
	 * bAchieve = bCity = false; break; case 304: bCity = true; iCity = 2;
	 * bDepartment =bTitle = bCompany = bReport = bMember = bDuty = bOther =
	 * bAchieve = bReason = false; break; case 306: bReport = true; iReport = 2;
	 * bDepartment =bTitle = bCompany = bMember = bDuty = bOther = bAchieve =
	 * bReason = bCity = false; break; case 307: bOther = true; iOther = 2;
	 * bDepartment =bTitle = bCompany = bReport = bMember = bDuty = bAchieve =
	 * bReason = bCity = false; break; case 308: bDepartment = true; iDepartment
	 * = 2; bOther =bTitle = bCompany = bReport = bMember = bDuty = bAchieve =
	 * bReason = bCity = false; break; default: break; } } if (bDepartment&&
	 * (iDepartment== 1)) { sDepartment.append(temp); iDepartment = 2; } if
	 * (bCompany && (iCompany == 1)) { sCompany.append(temp); iCompany = 2; } if
	 * (bTitle && (iTitle == 1)) { sTitle.append(temp); iTitle = 2; } if
	 * (bReport && (iReport == 1)) { sReport.append(temp); iReport = 2; } if
	 * (bMember && (iMember == 1)) { sMember.append(temp); iMember = 2; } if
	 * (bDuty && (iDuty == 1)) { sDuty.append(temp); iDuty = 2; } if (bOther &&
	 * (iOther == 1)) { sOther.append(temp); iOther = 2; } if (bAchieve &&
	 * (iAchieve == 1)) { sAchieve.append(temp); iAchieve = 2; } if (bReason &&
	 * (iReason == 1)) { sReason.append(temp); iReason = 2; } if (bCity &&
	 * (iCity == 1)) { sCity.append(temp); iCity = 2; } } Job jobinfo = new
	 * Job(); String text = sList.get(i);
	 * jobinfo.setStartTime(getStartTime(text)); String textSen = (i +
	 * 1)>=sList.size()?"":sList.get(i + 1);
	 * jobinfo.setEndTime(getStartTime(textSen));
	 * jobinfo.setAchieve(sAchieve.toString());
	 * jobinfo.setCity(sCity.toString());
	 * jobinfo.setCompany(sCompany.toString());
	 * jobinfo.setDuty(sDuty.toString());
	 * jobinfo.setDepartment(sDepartment.toString()); jobinfo.setReport(
	 * sReport.toString()); jobinfo.setReason(sReason.toString());
	 * jobinfo.setMember(sMember.toString());
	 * jobinfo.setTitle(sTitle.toString()); jobinfo.setJobInfo(info.trim());
	 * jobinfo.setCandidateid(id); jobinfo.setUpdateTime(new Date());
	 * dao.insertJob(jobinfo); sDepartment = sAchieve = sCity = sCompany = sDuty
	 * = sMember = sReport= sReason =sMember=sTitle= null; jobinfo = null ; } i
	 * += 2; } iList = null; sList = null; } //
	 */

	/**
	 * 函数名：parseEducation() 功 能：识别教育背景信息块的起止时间、学校、专业、学历
	 * 
	 */
	/// *
	private void parseEducationBehind(int id, String info, IDatabaseDao dao, CVObject map) throws IOException {
		info = info.replaceAll("||    |||", "");
		// System.out.println(info);
		StringBuffer sEducation = new StringBuffer();
		List<Integer> iList = new ArrayList<Integer>();
		List<String> sList = new ArrayList<String>();
		List<EducationNow> eList = new ArrayList<EducationNow>();
		if (map.getEducations() != null) {
			eList = map.getEducations();
		}
		Pattern pattern = Pattern.compile(
				"((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前|今|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))");
		Matcher matcher = pattern.matcher(info);
		while (matcher.find()) {
			matcher.appendReplacement(sEducation, info);
			String str = matcher.group();
			// System.out.println(str);
			sList.add(str);
			iList.add(matcher.start());
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i + 1) - iList.get(i) >= 15) {
				iList.set(i, info.length() * 2);
				i++;
			} else {
				i = i + 2;
			}
		}

		for (int i = 0; i < iList.size() - 1;) {
			if (iList.get(i) == info.length() * 2) {
				iList.remove(i);
				sList.remove(i);
			} else {
				i++;
			}
		}

		if (iList.size() % 2 == 1) {
			iList.remove(iList.size() - 1);
			sList.remove(sList.size() - 1);
		}

		// 处理只有年份的情况
		if (iList.size() < 2) {
			Pattern pattern1 = Pattern.compile(
					"((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2}))|((19\\d{2}|20\\d{2})年)|((19\\d{2}|20\\d{2}))|现在|至今|到现在|目前 ");
			Matcher matcher1 = pattern1.matcher(info);
			while (matcher1.find()) {
				String str = matcher1.group();
				sList.add(str);
				iList.add(matcher1.start());
			}

			for (Integer iListOne : iList) {
				// System.out.println(iListOne);
			}
			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i + 1) - iList.get(i) >= 15) {
					iList.set(i, info.length() * 2);
					i++;
				} else {
					i = i + 2;
				}
			}

			for (int i = 0; i < iList.size() - 1;) {
				if (iList.get(i) == info.length() * 2) {
					iList.remove(i);
					sList.remove(i);
				} else {
					i++;
				}
			}

			if (iList.size() % 2 == 1) {
				iList.remove(iList.size() - 1);
				sList.remove(sList.size() - 1);
			}
		}

		int length = info.length();
		String edu = "";
		Lexeme lex = null;
		String temp = "";
		int type = 0;
		int iSchool, iMajor, iDegree;
		iSchool = iMajor = iDegree = 0;
		int maxTime = 0;
		for (int i = 0, len = iList.size(); i < len;) {
			if (iList.size() > 2) {
				if (i == 0) {
					String school = "";
					String major = "";
					String degree = "";
					edu = info.substring(iList.get(i), iList.get(i + 2));
					StringReader sr = new StringReader(edu);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iSchool--;
						iDegree--;
						iMajor--;
						temp = lex.getLexemeText();
						// System.out.println("temp = " + temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							case 3:
								iSchool = 2;
								break;
							case 13:
								iMajor = 2;
								break;
							case 5:
								// iDegree = 2;
								degree = temp;
								break;
							case 251:
								// iDegree = 2;
								degree = temp;
								break;
							case 252:
								// iDegree = 2;
								degree = temp;
								break;
							case 253:
								// iDegree = 2;
								degree = temp;
								break;
							default:
								break;
							}
						}
						if (iSchool == 2) {
							if (school.isEmpty())
								school = lex.getLexemeText();
							// System.out.println(school);
						}
						if (iMajor == 2) {
							if (major.isEmpty())
								major = lex.getLexemeText();
						}

					}
					EducationNow education = new EducationNow();
					String text = sList.get(i);
					education.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					education.setEndTime(getStartTime(textSen));
					education.setSchool(school);
					if (education.getSchool().length() > 22) {
						education.setSchool(education.getSchool().substring(0, 21));
					}
					// System.out.println("education school = " +
					// education.getSchool());
					education.setMajor(major);
					BasicDE basicDE = new BasicDE();
					// System.out.println("degree = " + degree);
					if (degree.contains("专科") || degree.contains("大专")) {
						basicDE.setId(3);
					} else if (degree.contains("本科") || degree.contains("学士")) {
						basicDE.setId(4);
					} else if (degree.contains("硕士") || degree.contains("研究生")) {
						basicDE.setId(5);
					} else if (degree.contains("博士")) {
						basicDE.setId(6);
					} else if (degree.contains("博士后")) {
						basicDE.setId(7);
					}
					education.setDegree(basicDE);
					// System.out.println(education.getDegree().getId());
					int staIndex = edu.indexOf(sList.get(i));
					int endIndex = staIndex;
					String subInfo = "";
					String infoFirst="";
					if ((i + 1) < sList.size()) {
						endIndex = edu.indexOf(sList.get(i + 1));
						subInfo = edu.substring(staIndex, endIndex + sList.get(i + 1).length());
						infoFirst = edu.substring(endIndex + sList.get(i + 1).length()) ;
					} else {
						subInfo = edu.substring(staIndex, staIndex + sList.get(i).length());
						infoFirst = edu.substring(staIndex + sList.get(i).length()) ;
					}
					 
					education.setInfo(infoFirst);
					education.setEducationInfo(info.trim());
					// System.out.println("education" + education.toString() );
					// System.out.println("degree = " +
					// education.getDegree().getId());
					// System.out.println(education.getSchool() != null &&
					// education.getDegree().getId() != 0);
					if (education.getSchool() != null && !education.getSchool().equals("")) {
						eList.add(education);
						Education tempeducation = new Education();
						tempeducation.setStartTime(education.getStartTime());
						tempeducation.setEndTime(education.getEndTime());
						tempeducation.setSchool(education.getSchool());
						if (tempeducation.getSchool().length() > 22) {
							tempeducation.setSchool(tempeducation.getSchool().substring(0, 21));
						}
						tempeducation.setMajor(education.getMajor());
						tempeducation.setDegree(education.getDegree().getId());
						tempeducation.setInfo(education.getInfo());
						tempeducation.setEducationInfo(education.getEducationInfo());
						tempeducation.setCandidateid(id);
						tempeducation.setUpdateTime(new Date());
						dao.insertEducation(tempeducation);
					} else {
						// eList.add(education);
					}

					education = null;
				} else if (i < len - 3) {
					String school = "";
					String major = "";
					String degree = "";
					edu = info.substring(iList.get(i), iList.get(i + 2));
					StringReader sr = new StringReader(edu);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iSchool--;
						iDegree--;
						iMajor--;
						temp = lex.getLexemeText();
						// System.out.println("temp = " + temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							case 3:
								iSchool = 2;
								break;
							case 13:
								iMajor = 2;
								break;
							case 5:
								// iDegree = 2;
								degree = temp;
								break;
							case 251:
								// iDegree = 2;
								degree = temp;
								break;
							case 252:
								// iDegree = 2;
								degree = temp;
								break;
							case 253:
								// iDegree = 2;
								degree = temp;
								break;
							default:
								break;
							}
						}
						if (iSchool == 2)
							if (school.isEmpty())
								school = lex.getLexemeText();
						if (iMajor == 2)
							if (major.isEmpty())
								major = lex.getLexemeText();

					}
					EducationNow education = new EducationNow();
					String text = sList.get(i);
					education.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					education.setEndTime(getStartTime(textSen));
					education.setSchool(school);
					if (education.getSchool().length() > 22) {
						education.setSchool(education.getSchool().substring(0, 21));
					}
					education.setMajor(major);
					BasicDE basicDE = new BasicDE();
					if (degree.contains("专科") || degree.contains("大专")) {
						basicDE.setId(3);
					} else if (degree.contains("本科") || degree.contains("学士")) {
						basicDE.setId(4);
					} else if (degree.contains("硕士") || degree.contains("研究生")) {
						basicDE.setId(5);
					} else if (degree.contains("博士")) {
						basicDE.setId(6);
					} else if (degree.contains("博士后")) {
						basicDE.setId(7);
					}
					education.setDegree(basicDE);
					// System.out.println(education.getDegree().getId());
					int staIndex = edu.indexOf(sList.get(i));
					int endIndex = staIndex;
					String subInfo = "";
					String infoFirst  = "";
					if ((i + 1) < sList.size()) {
						endIndex = edu.indexOf(sList.get(i + 1));
						subInfo = edu.substring(staIndex, endIndex + sList.get(i + 1).length());
						infoFirst = edu.substring(endIndex + sList.get(i + 1).length());
					} else {
						subInfo = edu.substring(staIndex, staIndex + sList.get(i).length());
						infoFirst = edu.substring(staIndex + sList.get(i).length());
					} 
					education.setInfo(infoFirst);
					education.setEducationInfo(info.trim());
					// System.out.println("education" + education.toString() );
					if (education.getSchool() != null && !education.getSchool().equals("")) {
						eList.add(education);
						Education tempeducation = new Education();
						tempeducation.setStartTime(education.getStartTime());
						tempeducation.setEndTime(education.getEndTime());
						tempeducation.setSchool(education.getSchool());
						if (tempeducation.getSchool().length() > 22) {
							tempeducation.setSchool(tempeducation.getSchool().substring(0, 21));
						}
						tempeducation.setMajor(education.getMajor());
						tempeducation.setDegree(education.getDegree().getId());
						tempeducation.setInfo(education.getInfo());
						tempeducation.setEducationInfo(education.getEducationInfo());
						tempeducation.setCandidateid(id);
						tempeducation.setUpdateTime(new Date());
						dao.insertEducation(tempeducation);
					} else {
						// eList.add(education);
					}

					education = null;
				} else {
					String school = "";
					String major = "";
					String degree = "";
					edu = info.substring(iList.get(i), length);
					StringReader sr = new StringReader(edu);
					IKSegmenter ik = new IKSegmenter(sr, true);
					while ((lex = ik.next()) != null) {
						iSchool--;
						iDegree--;
						iMajor--;
						temp = lex.getLexemeText();
						// System.out.println("temp = " + temp);
						if (m_UserDic.containsKey(temp)) {
							type = m_UserDic.get(temp);
							switch (type) {
							case 3:
								iSchool = 2;
								break;
							case 13:
								iMajor = 2;
								break;
							case 5:
								// iDegree = 2;
								degree = temp;
								break;
							case 251:
								// iDegree = 2;
								degree = temp;
								break;
							case 252:
								// iDegree = 2;
								degree = temp;
								break;
							case 253:
								// iDegree = 2;
								degree = temp;
								break;
							default:
								break;
							}
						}
						if (iSchool == 2)
							if (school.isEmpty())
								school = lex.getLexemeText();
						if (iMajor == 2)
							if (major.isEmpty())
								major = lex.getLexemeText();

					}
					EducationNow education = new EducationNow();
					String text = sList.get(i);
					education.setStartTime(getStartTime(text));
					String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
					education.setEndTime(getStartTime(textSen));
					education.setSchool(school);
					if (education.getSchool().length() > 22) {
						education.setSchool(education.getSchool().substring(0, 21));
					}
					education.setMajor(major);
					BasicDE basicDE = new BasicDE();
					if (degree.contains("专科") || degree.contains("大专")) {
						basicDE.setId(3);
					} else if (degree.contains("本科") || degree.contains("学士")) {
						basicDE.setId(4);
					} else if (degree.contains("硕士") || degree.contains("研究生")) {
						basicDE.setId(5);
					} else if (degree.contains("博士")) {
						basicDE.setId(6);
					} else if (degree.contains("博士后")) {
						basicDE.setId(7);
					}
					education.setDegree(basicDE);
					// System.out.println(education.getDegree().getId());
					int staIndex = edu.indexOf(sList.get(i));
					int endIndex = staIndex;
					String subInfo = "";
					String infoFirst = "";
					if ((i + 1) < sList.size()) {
						endIndex = edu.indexOf(sList.get(i + 1));
						subInfo = edu.substring(staIndex, endIndex + sList.get(i + 1).length());
						infoFirst = edu.substring(endIndex + sList.get(i + 1).length());
					} else {
						subInfo = edu.substring(staIndex, staIndex + sList.get(i).length());
						infoFirst = edu.substring(endIndex + sList.get(i + 1).length());
					}
					education.setInfo(infoFirst);
					education.setEducationInfo(info.trim());
					// System.out.println("education" + education.toString() );
					if (education.getSchool() != null && !education.getSchool().equals("")) {
						eList.add(education);
						Education tempeducation = new Education();
						tempeducation.setStartTime(education.getStartTime());
						tempeducation.setEndTime(education.getEndTime());
						tempeducation.setSchool(education.getSchool());
						if (tempeducation.getSchool().length() > 22) {
							tempeducation.setSchool(tempeducation.getSchool().substring(0, 21));
						}
						tempeducation.setMajor(education.getMajor());
						tempeducation.setDegree(education.getDegree().getId());
						tempeducation.setInfo(education.getInfo());
						tempeducation.setEducationInfo(education.getEducationInfo());
						tempeducation.setCandidateid(id);
						tempeducation.setUpdateTime(new Date());
						dao.insertEducation(tempeducation);
					} else {
						// eList.add(education);
					}

					education = null;
				}
			} else // iList.size < 2
			{
				// System.out.println("list size <= 2");
				String school = "";
				String major = "";
				String degree = "";
				edu = info.substring(0, length);
				StringReader sr = new StringReader(edu);
				IKSegmenter ik = new IKSegmenter(sr, true);
				while ((lex = ik.next()) != null) {
					iSchool--;
					iDegree--;
					iMajor--;
					temp = lex.getLexemeText();
					// System.out.println("temp = " + temp);
					if (m_UserDic.containsKey(temp)) {
						type = m_UserDic.get(temp);
						switch (type) {
						case 3:
							iSchool = 2;
							break;
						case 13:
							iMajor = 2;
							break;
						case 5:
							// iDegree = 2;
							degree = temp;
							break;
						case 251:
							// iDegree = 2;
							// degree = temp;
							break;
						case 252:
							// iDegree = 2;
							// degree = temp;
							break;
						case 253:
							// iDegree = 2;
							// degree = temp;
							break;
						default:
							break;
						}
					}
					if (iSchool == 2)
						if (school.isEmpty())
							school = lex.getLexemeText();
					if (iMajor == 2)
						if (major.isEmpty())
							major = lex.getLexemeText();

				}
				EducationNow education = new EducationNow();
				String text = sList.get(i);
				education.setStartTime(getStartTime(text));
				String textSen = (i + 1) >= sList.size() ? "" : sList.get(i + 1);
				education.setEndTime(getStartTime(textSen));
				education.setSchool(school);
				if (education.getSchool().length() > 22) {
					education.setSchool(education.getSchool().substring(0, 21));
				}
				education.setMajor(major);
				BasicDE basicDE = new BasicDE();
				// System.out.println(degree);
				// System.out.println(degree.contains("本科"));
				if (degree.contains("专科") || degree.contains("大专")) {
					basicDE.setId(3);
				} else if (degree.contains("本科") || degree.contains("学士")) {
					basicDE.setId(4);
				} else if (degree.contains("硕士") || degree.contains("研究生")) {
					basicDE.setId(5);
				} else if (degree.contains("博士")) {
					basicDE.setId(6);
				} else if (degree.contains("博士后")) {
					basicDE.setId(7);
				}
				education.setDegree(basicDE);
				// System.out.println(education.getDegree().getId());
				int staIndex = edu.indexOf(sList.get(i));
				int endIndex = staIndex;
				String subInfo = "";
				String infoFirst = "";
				if ((i + 1) < sList.size()) {
					endIndex = edu.indexOf(sList.get(i + 1));
					subInfo = edu.substring(staIndex, endIndex + sList.get(i + 1).length());
					infoFirst = edu.substring(endIndex + sList.get(i + 1).length());
				} else {
					subInfo = edu.substring(staIndex, staIndex + sList.get(i).length());
					infoFirst = edu.substring(staIndex + sList.get(i).length());
				} 
				education.setInfo(infoFirst);
				education.setEducationInfo(info.trim());
				// System.out.println("education" + education.toString() );
				if (education.getSchool() != null && !education.getSchool().equals("")) {
					eList.add(education);
					Education tempeducation = new Education();
					tempeducation.setStartTime(education.getStartTime());
					tempeducation.setEndTime(education.getEndTime());
					tempeducation.setSchool(education.getSchool());
					if (tempeducation.getSchool().length() > 22) {
						tempeducation.setSchool(tempeducation.getSchool().substring(0, 21));
					}
					tempeducation.setMajor(education.getMajor());
					tempeducation.setDegree(education.getDegree().getId());
					tempeducation.setInfo(education.getInfo());
					tempeducation.setEducationInfo(education.getEducationInfo());
					tempeducation.setCandidateid(id);
					tempeducation.setUpdateTime(new Date());
					dao.insertEducation(tempeducation);
				} else {
					// eList.add(education);
				}

				education = null;
			}
			i += 2;
		}
		map.setEducations(eList);

		iList = null;
		sList = null;
		eList = null;
	}
	// */

	/*
	 * private void parseEducationBehind(int id ,String info,IDatabaseDao dao)
	 * throws IOException { StringBuffer sEducation = new StringBuffer();
	 * List<Integer> iList = new ArrayList<Integer>(); List<String> sList = new
	 * ArrayList<String>(); Pattern pattern = Pattern.compile(
	 * "((19\\d{2}|20\\d{2})\\/\\d{1,2})|((19\\d{2}|20\\d{2})-\\d{1,2})|((19\\d{2}|20\\d{2})年\\d{1,2}月)|((19\\d{2}|20\\d{2})\\.\\d{1,2})|现在|至今|到现在|目前"
	 * ); Matcher matcher = pattern.matcher(info); while (matcher.find()) {
	 * matcher.appendReplacement(sEducation, info); String str =
	 * matcher.group(); sList.add(str); iList.add(matcher.start()); } Pattern
	 * pyear = Pattern.compile("\\d{4}"); Pattern pMonth =
	 * Pattern.compile("\\d{2}"); Pattern pDay= Pattern.compile("\\d{1}"); int
	 * length = info.length(); String edu = ""; Lexeme lex = null; String temp =
	 * ""; int type = 0; int iSchool, iMajor, iDegree; iSchool = iMajor =
	 * iDegree = 0; for (int i = 0, len = iList.size(); i < len;) { if
	 * (iList.size() > 2) { if (i == 0) { String school = ""; String major = "";
	 * String degree = ""; edu = info.substring(iList.get(i), iList.get(i + 2));
	 * StringReader sr = new StringReader(edu); IKSegmenter ik = new
	 * IKSegmenter(sr, true); while ((lex = ik.next()) != null) { iSchool--;
	 * iDegree--; iMajor--; temp = lex.getLexemeText(); if
	 * (m_UserDic.containsKey(temp)) { type = m_UserDic.get(temp); switch (type)
	 * { case 3: iSchool = 2; break; case 216: iMajor = 2; break; case 205:
	 * iDegree = 2; break; default: break; } } if (iSchool == 2) school =
	 * lex.getLexemeText(); if (iMajor == 1) major = lex.getLexemeText(); if
	 * (iDegree == 1) degree = lex.getLexemeText(); } Education education = new
	 * Education(); education.setStartTime(getStartTime(sList.get(i))); String
	 * textSen = (i + 1)>=sList.size()?"":sList.get(i + 1);
	 * education.setEndTime(getStartTime(textSen)); education.setSchool(school);
	 * education.setMajor(major); BasicDE basicDE = new BasicDE();
	 * if(edu.contains("专科")||edu.contains("大专")) { basicDE.setId(3); }else
	 * if(edu.contains("本科")||edu.contains("学士")){ basicDE.setId(4); }else
	 * if(edu.contains("硕士")||edu.contains("研究生")){ basicDE.setId(5); }else
	 * if(edu.contains("博士")){ basicDE.setId(6); }else if(edu.contains("博士后")){
	 * basicDE.setId(7); } education.setDegree(basicDE.getId()); //学历
	 * education.setEducationInfo(info.trim()); education.setCandidateid(id);
	 * education.setUpdateTime(new Date()); dao.insertEducation(education);
	 * education = null ; } else if (i < len - 3) { String school = ""; String
	 * major = ""; String degree = ""; edu = info.substring(iList.get(i),
	 * iList.get(i + 2)); StringReader sr = new StringReader(edu); IKSegmenter
	 * ik = new IKSegmenter(sr, true); while ((lex = ik.next()) != null) {
	 * iSchool--; iDegree--; iMajor--; temp = lex.getLexemeText(); if
	 * (m_UserDic.containsKey(temp)) { type = m_UserDic.get(temp); switch (type)
	 * { case 3: iSchool = 2; break; case 216: iMajor = 2; break; case 205:
	 * iDegree = 2; break; default: break; } } if (iSchool == 2) school =
	 * lex.getLexemeText(); if (iMajor == 1) major = lex.getLexemeText(); if
	 * (iDegree == 1) degree = lex.getLexemeText();
	 * 
	 * } Education education = new Education(); String text = sList.get(i);
	 * education.setStartTime(getStartTime(text)); String textSen = (i +
	 * 1)>=sList.size()?"":sList.get(i + 1);
	 * education.setEndTime(getStartTime(textSen)); education.setSchool(school);
	 * education.setMajor(major); BasicDE basicDE = new BasicDE();
	 * if(edu.contains("专科")||edu.contains("大专")) { basicDE.setId(3); }else
	 * if(edu.contains("本科")||edu.contains("学士")){ basicDE.setId(4); }else
	 * if(edu.contains("硕士")||edu.contains("研究生")){ basicDE.setId(5); }else
	 * if(edu.contains("博士")){ basicDE.setId(6); }else if(edu.contains("博士后")){
	 * basicDE.setId(7); } education.setDegree(basicDE.getId());
	 * education.setEducationInfo(info.trim()); education.setCandidateid(id);
	 * education.setUpdateTime(new Date()); dao.insertEducation(education);
	 * education = null ; } else { String school = ""; String major = ""; String
	 * degree = ""; edu = info.substring(iList.get(i), length); StringReader sr
	 * = new StringReader(edu); IKSegmenter ik = new IKSegmenter(sr, true);
	 * while ((lex = ik.next()) != null) { iSchool--; iDegree--; iMajor--; temp
	 * = lex.getLexemeText(); if (m_UserDic.containsKey(temp)) { type =
	 * m_UserDic.get(temp); switch (type) { case 3: iSchool = 2; break; case
	 * 216: iMajor = 2; break; case 205: iDegree = 2; break; default: break; } }
	 * if (iSchool == 2) school = lex.getLexemeText(); if (iMajor == 1) major =
	 * lex.getLexemeText(); if (iDegree == 1) degree = lex.getLexemeText();
	 * 
	 * } Education education = new Education(); String text = sList.get(i);
	 * education.setStartTime(getStartTime(text)); String textSen = (i +
	 * 1)>=sList.size()?"":sList.get(i + 1);
	 * education.setEndTime(getStartTime(textSen)); education.setSchool(school);
	 * education.setMajor(major); BasicDE basicDE = new BasicDE();
	 * if(edu.contains("专科")||edu.contains("大专")) { basicDE.setId(3); }else
	 * if(edu.contains("本科")||edu.contains("学士")){ basicDE.setId(4); }else
	 * if(edu.contains("硕士")||edu.contains("研究生")){ basicDE.setId(5); }else
	 * if(edu.contains("博士")){ basicDE.setId(6); }else if(edu.contains("博士后")){
	 * basicDE.setId(7); } education.setDegree(basicDE.getId());
	 * education.setEducationInfo(info.trim()); education.setCandidateid(id);
	 * education.setUpdateTime(new Date()); dao.insertEducation(education);
	 * education = null ; } } else { String school = ""; String major = "";
	 * String degree = ""; edu = info.substring(0, length); StringReader sr =
	 * new StringReader(edu); IKSegmenter ik = new IKSegmenter(sr, true); while
	 * ((lex = ik.next()) != null) { iSchool--; iDegree--; iMajor--; temp =
	 * lex.getLexemeText(); if (m_UserDic.containsKey(temp)) { type =
	 * m_UserDic.get(temp); switch (type) { case 3: iSchool = 2; break; case
	 * 216: iMajor = 2; break; case 205: iDegree = 2; break; default: break; } }
	 * if (iSchool == 2) school = lex.getLexemeText(); if (iMajor == 1) major =
	 * lex.getLexemeText(); if (iDegree == 1) degree = lex.getLexemeText();
	 * 
	 * } Education education = new Education(); String text = sList.get(i);
	 * education.setStartTime(getStartTime(text)); String textSen = (i +
	 * 1)>=sList.size()?"":sList.get(i + 1);
	 * education.setEndTime(getStartTime(textSen)); education.setSchool(school);
	 * education.setMajor(major); BasicDE basicDE = new BasicDE();
	 * if(edu.contains("专科")||edu.contains("大专")) { basicDE.setId(3); }else
	 * if(edu.contains("本科")||edu.contains("学士")){ basicDE.setId(4); }else
	 * if(edu.contains("硕士")||edu.contains("研究生")){ basicDE.setId(5); }else
	 * if(edu.contains("博士")){ basicDE.setId(6); }else if(edu.contains("博士后")){
	 * basicDE.setId(7); } education.setDegree(basicDE.getId());
	 * education.setEducationInfo(info.trim()); education.setCandidateid(id);
	 * education.setUpdateTime(new Date()); dao.insertEducation(education);
	 * education = null ; } i += 2; } iList = null; sList = null; } //
	 */

	/**
	 * 函数名：parseBasic() 功 能：识别基本信息块的姓名、性别、年龄、现居地、学校、学历 * 手机、邮箱、公司、职位、专业等。
	 * 
	 */
	/// *
	private boolean parseBasicBehind(int id, int ownerid, int companyid, String info, IDatabaseDao dao, CVObject map)
			throws IOException {
		boolean bFlag = false;
		info = info.replaceAll("||    |||", "");
		// System.out.println("Basic Info = " + info);
		StringBuilder sName = new StringBuilder();
		StringBuilder sLocation = new StringBuilder();
		StringBuilder sSchool = new StringBuilder();
		StringBuilder sDegree = new StringBuilder();
		StringBuilder sCompany = new StringBuilder();
		StringBuilder sTitle = new StringBuilder();
		StringBuilder sHeight = new StringBuilder();
		StringBuilder sWeight = new StringBuilder();
		StringBuilder sBWH = new StringBuilder();
		StringBuilder sMarriage = new StringBuilder();
		StringBuilder sNation = new StringBuilder();
		StringBuilder sMajor = new StringBuilder();
		StringBuilder sPolitics = new StringBuilder();
		StringBuilder sCountry = new StringBuilder();
		StringBuilder sHealth = new StringBuilder();
		String basicSchool = "";
		String sCity = "";
		int iBasicSchool, iCountry, iHealth, iPolitics, iName, iLocation, iSchool, iDegree, iCompany, iTitle, iHeight,
				iWeight, iBWH, iMarriage, iNation, iMajor;
		iBasicSchool = iCountry = iHealth = iPolitics = iName = iLocation = iSchool = iDegree = iCompany = iTitle = iHeight = iWeight = iBWH = iMarriage = iNation = iMajor = 0;
		boolean bCountry, bHealth, bPolitics, bName, bLocation, bSchool, bDegree, bCompany, bTitle, bHeight, bWeight,
				bBWH, bMarriage, bNation, bMajor;
		bCountry = bHealth = bPolitics = bName = bLocation = bSchool = bDegree = bCompany = bTitle = bHeight = bWeight = bBWH = bMarriage = bNation = bMajor = false;
		int type = 0;
		boolean bBasicSchool = true;
		StringReader sr = new StringReader(info);
		IKSegmenter ik = new IKSegmenter(sr, true);
		Lexeme lex = null;
		String temp = "";
		while ((lex = ik.next()) != null) {
			iBasicSchool--;
			iHealth--;
			iCountry--;
			iPolitics--;
			iName--;
			iLocation--;
			iSchool--;
			iDegree--;
			iCompany--;
			iTitle--;
			iHeight--;
			iWeight--;
			iBWH--;
			iMarriage--;
			iNation--;
			iMajor--;
			temp = lex.getLexemeText();
			if (temp != null && m_UserDic.containsKey(temp)) {
				type = m_UserDic.get(temp);
				switch (type) {
				case 3:
					iBasicSchool = 1;
					break;
				case 200:
					bName = true;
					iName = 2;
					bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 201:
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 202:
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 203:
					bLocation = true;
					bName = bSchool = bCompany = bMajor = false;
					iLocation = 2;
					break;
				case 204:
					bSchool = true;
					iSchool = 2;
					bName = bLocation = bCompany = bMajor = false;
					break;
				case 205:
					bDegree = true;
					iDegree = 2;
					bCompany = bName = bLocation = bSchool = bMajor = false;
					break;
				case 206:
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 207:
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 208:
					bCompany = true;
					iCompany = 2;
					bName = bSchool = bLocation = bMajor = false;
					break;
				case 209:
					bTitle = true;
					iTitle = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 210:
					bName = bSchool = bLocation = bCompany = bMajor = false;
					break;
				case 211:
					bHeight = true;
					iHeight = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 212:
					bWeight = true;
					iWeight = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 213:
					bBWH = true;
					iBWH = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 214:
					bMarriage = true;
					iMarriage = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 215:
					bNation = true;
					iNation = 2;
					bCompany = bName = bSchool = bLocation = bMajor = false;
					break;
				case 216:
					bMajor = true;
					iMajor = 2;
					bCompany = bName = bSchool = bLocation = false;
					break;
				case 217:
					bHealth = true;
					iHealth = 2;
					bMajor = bCompany = bName = bSchool = bLocation = false;
					break;
				case 218:
					bCountry = true;
					iCountry = 2;
					bMajor = bCompany = bName = bSchool = bLocation = false;
					break;
				case 219:
					bPolitics = true;
					iPolitics = 2;
					bMajor = bCompany = bName = bSchool = bLocation = false;
					break;
				case 16:
					if (sCity == null || sCity.equals("")) {
						sCity = temp;
					}
				default:
					break;
				}
			}
			if (bBasicSchool && iBasicSchool == 1) {
				basicSchool = temp;
			}
			if (bCountry && iCountry == 1) {
				sCountry.append(temp);
			}
			if (bHealth && iHealth == 1) {
				sHealth.append(temp);
			}
			if (bPolitics && iPolitics == 1) {
				sPolitics.append(temp);
			}
			if (bName && iName == 1) {
				if (sName != null && sName.length() <= 10) {
					sName.append(temp);
					iName = 2;
				}
			}
			if (bLocation && iLocation == 1) {
				if (sLocation != null && sLocation.length() <= 15) {
					sLocation.append(temp);
					iLocation = 2;
				}
			}
			if (bSchool && iSchool == 1) {
				if (sSchool != null && sSchool.length() <= 15) {
					sSchool.append(temp);
					iSchool = 2;
				}
			}
			if (bDegree && iDegree == 1) {
				sDegree.append(temp);
			}
			if (bCompany && iCompany == 1) {
				if (sCompany != null && sCompany.length() <= 20) {
					sCompany.append(temp);
					iCompany = 2;
				}
			}
			if (bTitle && iTitle == 1)
				sTitle.append(temp);
			if (bHeight && iHeight == 1)
				sHeight.append(temp);
			if (bWeight && iWeight == 1)
				sWeight.append(temp);
			if (bBWH && iBWH == 1)
				sBWH.append(temp);
			if (bMarriage && iMarriage == 1)
				sMarriage.append(temp);
			if (bNation && iNation == 1)
				sNation.append(temp);
			if (bMajor && iMajor == 1) {
				// System.out.println("major =" + sMajor + "=");
				// System.out.println(sMajor.length()==0);
				if (sMajor.length() == 0 && sMajor.length() <= 10) {
					sMajor.append(temp);
					iMajor = 2;
				}
			}
		}

		/// *
		BasicNow basic = new BasicNow();
		BasicES es = new BasicES();
		es.setId(67);
		basic.setExpectedSalary(es);
		BasicFunction function = new BasicFunction();
		function.setId(0);
		basic.setFunctionId(function);
		BasicJS js = new BasicJS();
		js.setId(65);
		basic.setJobStatus(js);
		BasicJT jt = new BasicJT();
		Pattern pjobTime = Pattern.compile("\\d{1}");
		Matcher mjobTime = pjobTime.matcher(jobtime);
		String tempJobTime = "";
		while (mjobTime.find()) {
			tempJobTime = mjobTime.group();
			break;
		}

		Pattern pjobTime2 = Pattern.compile("\\d{2}");
		Matcher mjobTime2 = pjobTime2.matcher(jobtime);
		while (mjobTime2.find()) {
			tempJobTime = mjobTime2.group();
			break;
		}
		int intJobTime = 0;
		if (tempJobTime != null && !tempJobTime.equals("")) {
			intJobTime = Integer.parseInt(tempJobTime);
		}
		if (intJobTime >= 1 && intJobTime <= 3) {
			jt.setId(12);
		} else if (intJobTime > 3 && intJobTime <= 5) {
			jt.setId(102);
		} else if (intJobTime > 5 && intJobTime <= 10) {
			jt.setId(103);
		} else if (intJobTime > 10) {
			jt.setId(104);
		} else {
			jt.setId(11);
		}

		BasicCV cv = new BasicCV();
		cv.setId(0);
		basic.setCv(cv);
		BasicDE basicDE = new BasicDE();
		if (degree != null && (degree.contains("专科") || degree.contains("大专"))) {
			basicDE.setId(3);
		} else if (degree != null && degree.contains("本科") || degree != null && degree.contains("学士")) {
			basicDE.setId(4);
		} else if (degree != null && degree.contains("硕士") || degree != null && degree.contains("研究生")) {
			basicDE.setId(5);
		} else if (degree != null && degree.contains("博士")) {
			basicDE.setId(6);
		} else if (degree != null && degree.contains("博士后")) {
			basicDE.setId(7);
		} else {
			basicDE.setId(0);
		}
		basic.setDegree(basicDE);
		basic.setMpc(0);
		basic.setCountry(sCountry.toString());
		basic.setHealth(sHealth.toString());
		basic.setPolitics(sPolitics.toString());
		basic.setBasicInfo(info);
		if (map.getBasic() != null) {
			if (map.getBasic().getName() == null || map.getBasic().getName().equals(""))
				basic.setName(sName.toString());
			else
				basic.setName(map.getBasic().getName());
		} else {
			basic.setName(sName.toString());
		}
		// basic.setName(sName.toString());
		if (sName != null && sName.toString().equals("")) {
			// basic.setName("人才");
		}
		basic.setGender(gender.equals("女") ? 2 : 0);
		if (basic.getGender() == 0) {
			basic.setGender(gender.equals("男") ? 1 : 0);
		}
		basic.setAge(getAgeNum(age));
		basic.setAddress(sLocation.toString());
		if (map.getBasic() != null) {
			if (map.getBasic().getSchool() == null || map.getBasic().getSchool().equals("")) {
				basic.setSchool(basicSchool);
				if (basic.getSchool().length() > 22) {
					basic.setSchool(basic.getSchool().substring(0, 21));
				}
			} else {
				basic.setSchool(map.getBasic().getSchool());
				if (basic.getSchool().length() > 22) {
					basic.setSchool(basic.getSchool().substring(0, 21));
				}
			}
		} else {
			basic.setSchool(basicSchool);
			if (basic.getSchool().length() > 22) {
				basic.setSchool(basic.getSchool().substring(0, 21));
			}
		}
		// basic.setSchool(basicSchool);
		phone = phone.replaceAll("-", "");
		basic.setMobile(phone);
		basic.setEmail(email);
		// basic.setJobTime(jt);
		Long longJobTime = new Long((long) intJobTime);
		basic.setJob_time(longJobTime);
		basic.setCompany(sCompany.toString());
		if (basic.getCompany().length() > 50) {
			basic.setCompany(basic.getCompany().substring(0, 49));
		}
		basic.setTitle(sTitle.toString());
		if (basic.getTitle().length() > 12) {
			basic.setTitle(basic.getTitle().substring(0, 11));
		}
		basic.setHeight(sHeight.toString());
		basic.setWeight(sWeight.toString());
		basic.setBwh(sBWH.toString());
		basic.setMarriage(sMarriage.toString().equals("") ? 0 : 1);
		if (map.getBasic() != null) {
			if (map.getBasic().getMajor() == null || map.getBasic().getMajor().equals(""))
				basic.setMajor(sMajor.toString().trim());
			else
				basic.setMajor(map.getBasic().getMajor());
		} else {
			basic.setMajor(sMajor.toString().trim());
		}
		// basic.setMajor(sMajor.toString().trim());
		basic.setBasicInfo(info);
		basic.setCity(sCity);
		map.setBasic(basic);
		// dao.insertBasic(basic);
		// */

		/*
		 * Basic basic = new Basic(); basic.setCountry(sCountry.toString());
		 * basic.setHealth(sHealth.toString());
		 * //basic.setNationality(sNationality.toString());
		 * basic.setBasicInfo(info); basic.setName(sName.toString());
		 * if(sName!=null&&sName.toString().equals("")){ basic.setName("人才"); }
		 * basic.setGender(genderBehind.toString().equals("男")?1:0);
		 * basic.setUpdateTime(new Date()); basic.setAge(ageBehind);
		 * basic.setAddress(sLocation.toString());
		 * basic.setSchool(sSchool.toString()); basic.setMobile(phoneBehind);
		 * basic.setEmail(emailBehind); basic.setJobTime(jobtimeBehind);
		 * basic.setCompany(sCompany.toString());
		 * basic.setTitle(sTitle.toString());
		 * basic.setHeight(sHeight.toString());
		 * basic.setWeight(sWeight.toString()); basic.setBwh(sBWH.toString());
		 * basic.setPhotoId(0);
		 * basic.setMarriage(sMarriage.toString().equals("")?0:1);
		 * basic.setMajor(sMajor.toString().trim()); basic.setBasicInfo(info);
		 * basic.setCandidateId(id); basic.setMpc(0); basic.setOwnerid(ownerid);
		 * basic.setCompany_id(companyid); basic.setProcessStage(0);
		 * basic.setFileid(id); //System.out.println(
		 * "--------------------1111111111111111111111111111------------"+basic.
		 * toString()); dao.insertBasic(basic); //
		 */

		bFlag = true;
		sName = sLocation = sSchool = sDegree = sCompany = sTitle = sHeight = sWeight = sBWH = sMarriage = sNation = sMajor = null;
		basic = null;
		return bFlag;
	}
	// */

	/*
	 * private boolean parseBasicBehind(int id ,int ownerid,int companyid,String
	 * info,IDatabaseDao dao) throws IOException { boolean bFlag = false;
	 * StringBuilder sName = new StringBuilder(); StringBuilder sLocation = new
	 * StringBuilder(); StringBuilder sSchool = new StringBuilder();
	 * StringBuilder sDegree = new StringBuilder(); StringBuilder sCompany = new
	 * StringBuilder(); StringBuilder sTitle = new StringBuilder();
	 * StringBuilder sHeight = new StringBuilder(); StringBuilder sWeight = new
	 * StringBuilder(); StringBuilder sBWH = new StringBuilder(); StringBuilder
	 * sMarriage = new StringBuilder(); StringBuilder sNation = new
	 * StringBuilder(); StringBuilder sMajor = new StringBuilder();
	 * StringBuilder sNationality = new StringBuilder(); StringBuilder sCountry
	 * = new StringBuilder(); StringBuilder sHealth = new StringBuilder(); int
	 * iCountry,iHealth,iNationality, iName, iLocation, iSchool, iDegree,
	 * iCompany, iTitle, iHeight, iWeight, iBWH, iMarriage, iNation, iMajor;
	 * iCountry=iHealth=iNationality = iName =iLocation = iSchool = iDegree =
	 * iCompany = iTitle = iHeight = iWeight = iBWH = iMarriage = iNation =
	 * iMajor = 0; boolean bCountry,bHealth, bNationality, bName, bLocation,
	 * bSchool, bDegree, bCompany, bTitle, bHeight, bWeight, bBWH, bMarriage,
	 * bNation, bMajor; bCountry = bHealth = bNationality = bName = bLocation =
	 * bSchool = bDegree = bCompany = bTitle = bHeight = bWeight = bBWH =
	 * bMarriage = bNation = bMajor = false; int type = 0; StringReader sr = new
	 * StringReader(info); IKSegmenter ik = new IKSegmenter(sr, true); Lexeme
	 * lex = null; String temp = ""; while ((lex = ik.next()) != null) {
	 * iHealth--; iCountry--; iNationality--; iName--; iLocation--; iSchool--;
	 * iDegree--; iCompany--; iTitle--; iHeight--; iWeight--; iBWH--;
	 * iMarriage--; iNation--; iMajor--; temp = lex.getLexemeText(); if (temp !=
	 * null && m_UserDic.containsKey(temp)) { type = m_UserDic.get(temp); switch
	 * (type) { case 200: bName = true; iName = 2; bSchool = bLocation =
	 * bCompany = bMajor = false; break; case 201: bName =bSchool = bLocation =
	 * bCompany = bMajor = false; break; case 202: bName =bSchool = bLocation =
	 * bCompany = bMajor = false; break; case 203: bLocation = true; bName =
	 * bSchool = bCompany = bMajor = false; iLocation = 2; break; case 204:
	 * bSchool = true; iSchool = 2; bName = bLocation = bCompany = bMajor =
	 * false; break; case 205: bDegree = true; iDegree = 2; bCompany = bName =
	 * bLocation = bSchool = bMajor = false; break; case 206: bName =bSchool =
	 * bLocation = bCompany = bMajor = false; break; case 207: bName =bSchool =
	 * bLocation = bCompany = bMajor = false; break; case 208: bCompany = true;
	 * iCompany = 2; bName = bSchool = bLocation = bMajor = false; break; case
	 * 209: bTitle = true; iTitle = 2; bCompany = bName = bSchool = bLocation =
	 * bMajor = false; break; case 210: bName =bSchool = bLocation = bCompany =
	 * bMajor = false; break; case 211: bHeight = true; iHeight = 2; bCompany =
	 * bName = bSchool = bLocation = bMajor = false; break; case 212: bWeight =
	 * true; iWeight = 2; bCompany = bName = bSchool = bLocation = bMajor =
	 * false; break; case 213: bBWH = true; iBWH = 2; bCompany = bName = bSchool
	 * = bLocation = bMajor = false; break; case 214: bMarriage = true;
	 * iMarriage = 2; bCompany = bName = bSchool = bLocation = bMajor = false;
	 * break; case 215: bNation = true; iNation = 2; bCompany = bName = bSchool
	 * = bLocation = bMajor = false; break; case 216: bMajor = true; iMajor = 2;
	 * bCompany = bName = bSchool = bLocation = false; break; case 217: bHealth
	 * = true; iHealth = 2; bMajor =bCompany = bName = bSchool = bLocation =
	 * false; break; case 218: bCountry = true; iCountry = 2; bMajor =bCompany =
	 * bName = bSchool = bLocation = false; break; case 219: bNationality =
	 * true; iNationality = 2; bMajor =bCompany = bName = bSchool = bLocation =
	 * false; break; default: break; } } if (bCountry && iCountry== 1) {
	 * sCountry.append(temp); } if (bHealth && iHealth== 1) {
	 * sHealth.append(temp); } if (bNationality && iNationality == 1) {
	 * sNationality.append(temp); } if (bName && iName == 1) {
	 * if(sName!=null&&sName.length()<=10){sName.append(temp); iName = 2;} } if
	 * (bLocation && iLocation == 1) {
	 * if(sLocation!=null&&sLocation.length()<=15){sLocation.append(temp);
	 * iLocation = 2;} } if (bSchool && iSchool == 1) {
	 * if(sSchool!=null&&sSchool.length()<=15){sSchool.append(temp); iSchool =
	 * 2;} } if (bDegree && iDegree == 1) { sDegree.append(temp); } if (bCompany
	 * && iCompany == 1) {
	 * if(sCompany!=null&&sCompany.length()<=20){sCompany.append(temp); iCompany
	 * = 2;} } if (bTitle && iTitle == 1) sTitle.append(temp); if (bHeight &&
	 * iHeight == 1) sHeight.append(temp); if (bWeight && iWeight == 1)
	 * sWeight.append(temp); if (bBWH && iBWH == 1) sBWH.append(temp); if
	 * (bMarriage && iMarriage == 1) sMarriage.append(temp); if (bNation &&
	 * iNation == 1) sNation.append(temp); if (bMajor && iMajor == 1) {
	 * if(sMajor!=null&&sMajor.length()<=10){sMajor.append(temp); iMajor = 2;} }
	 * } Basic basic = new Basic(); basic.setCountry(sCountry.toString());
	 * basic.setHealth(sHealth.toString());
	 * basic.setNationality(sNationality.toString()); basic.setBasicInfo(info);
	 * basic.setName(sName.toString());
	 * if(sName!=null&&sName.toString().equals("")){ basic.setName("人才"); }
	 * basic.setGender(genderBehind.toString().equals("男")?1:0);
	 * basic.setUpdateTime(new Date()); basic.setAge(ageBehind);
	 * basic.setAddress(sLocation.toString());
	 * basic.setSchool(sSchool.toString()); basic.setMobile(phoneBehind);
	 * basic.setEmail(emailBehind); basic.setJobTime(jobtimeBehind);
	 * basic.setCompany(sCompany.toString()); basic.setTitle(sTitle.toString());
	 * basic.setHeight(sHeight.toString()); basic.setWeight(sWeight.toString());
	 * basic.setBwh(sBWH.toString()); basic.setPhotoId(0);
	 * basic.setMarriage(sMarriage.toString().equals("")?0:1);
	 * basic.setMajor(sMajor.toString().trim()); basic.setBasicInfo(info);
	 * basic.setCandidateId(id); basic.setMpc(0); basic.setOwnerid(ownerid);
	 * basic.setCompany_id(companyid); basic.setProcessStage(0);
	 * basic.setFileid(id); //System.out.println(
	 * "--------------------1111111111111111111111111111------------"+basic.
	 * toString()); dao.insertBasic(basic); bFlag = true; sName = sLocation
	 * =sSchool =sDegree = sCompany =sTitle = sHeight = sWeight = sBWH =
	 * sMarriage = sNation = sMajor = null; basic = null; return bFlag; } //
	 */

	/*
	 * 张振华智联模板解析 2016.10.25
	 * 
	 */

}
